Re: In RULEs, INSERT does not use DEFAULTs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: In RULEs, INSERT does not use DEFAULTs
Date
Msg-id 10362.1118631382@sss.pgh.pa.us
Whole thread Raw
In response to In RULEs, INSERT does not use DEFAULTs  (David Fetter <david@fetter.org>)
Responses Re: In RULEs, INSERT does not use DEFAULTs
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> At one time, INSERTing a NULL into a column with a DEFAULT used to
> INSERT the DEFAULT.  Is there some way to get this behavior back?

PG has *never* done that in any version that I can recall, and it isn't
likely that we would install such an obvious violation of the SQL spec.

The correct way to get the behavior you are after is to attach a default
to the view's column (ALTER view ALTER col SET DEFAULT ...)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Implications of lo_create() for pg_dump
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Implications of lo_create() for pg_dump