Re: default value not working?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jason(dot)servetar(at)ccgenesis(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: default value not working?
Date: 2001-05-07 15:39:21
Message-ID: 21485.989249961@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

jason(dot)servetar(at)ccgenesis(dot)com writes:
> Ok, I ported my Oracle database and my developers started complaining that
> their defaults are not working. Could someone tell me if I am doing
> something wrong and what the workaround is.

All the examples you give look perfectly fine to me. Postgres does not
think that explicitly inserting a NULL means that the system should
substitute the default --- and the SQL standard agrees with us.
(Oracle is known to have rather broken handling of NULLs, so it wouldn't
surprise me a whole lot to hear that it gets this wrong ... but I don't
know for sure whether that's actually how it acts.)

Currently, to use a default value you have to omit the column entirely
from the column list in the INSERT command. (SQL92 says you can also
write DEFAULT as one of the items in the VALUES list, but we don't
support that syntax yet.)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael R. Jinks 2001-05-07 16:38:40 Re: Install of postgresql
Previous Message pejac 2001-05-07 15:36:57 re : default value not working?