jason.servetar@ccgenesis.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