Search Postgresql Archives

Re: Why is default value not working on insert?

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

 



On Tue, Aug 08, 2006 at 04:41:04PM -0400, Chris Hoover wrote:
> I have the following table:

<snip>

> 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?

If you try to insert a NULL into a not null column, you get an error.
To trigger the default you either need to omit the column from the
insert statement, or use the DEFAULT keyword.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[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