Search Postgresql Archives

Re: Why is default value not working on insert?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2006/8/8, Chris Hoover <revoohc@xxxxxxxxx>:
(...)
The reason for the null being passed to to_date is this is on of almot 90k
lines of data we are trying to load, and the script was built to generate
this code.  Since to_date(null,'yyyymmdd') returns a null, why is the
default not working?

Because you're trying to explicitly insert a NULL into a column which
is specified as NOT NULL.

(If you can't change the script to output DEFAULT or the explicit
default value, the best workaraound would be to create a trigger which
converts any attempt to insert a NULL value into that column to the
intended default value).


Ian Barwick


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux