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 02:56:22
Message-ID: 10362.1118631382@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:
> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-06-13 03:09:26 Re: Implications of lo_create() for pg_dump
Previous Message Tom Lane 2005-06-13 02:45:16 Implications of lo_create() for pg_dump