Re: In RULEs, INSERT does not use DEFAULTs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: In RULEs, INSERT does not use DEFAULTs
Date: 2005-06-13 03:48:29
Message-ID: 10814.1118634509@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> I believe this isn't just my problem. Without access to a the
> underlying column's DEFAULT, how can people implement the automated
> WRITEable VIEWs?

That's a reasonable question, but translating "insert null" to "insert
the default" is not a reasonable answer.

There was some speculation just a couple days ago about inventing a
function that would compute the default associated with some other
table's column, but it's not clear how to make that work (in
particular, how to declare the result type of such a function).

Another possibility is a command along the lines of
ALTER view ALTER col LINK DEFAULT TO othertable.col;
(syntax open to argument of course) which accomplishes the
same thing without having to figure a way to avoid the constraints
of a specific function result type.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2005-06-13 04:03:21 Re: In RULEs, INSERT does not use DEFAULTs
Previous Message David Fetter 2005-06-13 03:33:43 Re: In RULEs, INSERT does not use DEFAULTs