Search Postgresql Archives

Re: Blank, nullable date column rejected by psql

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

 




Ron,

All of you who responded drove home my need to explicitly enter null when
there are no data for a column.

Thanks,

Rich


Just in case you miss this little nuance, you don't necessarily _have_ to specify a NULL for that column, depending how you're doing your inserts.  You haven't show us your table or what INSERT you're using, but all of these examples will work, and don't specify an explicit NULL:

CREATE TEMP TABLE foo (a INTEGER NOT NULL, b INTEGER NOT NULL, c DATE);
CREATE TABLE

INSERT INTO foo VALUES (1,2);
INSERT 0 1
                               ^
INSERT INTO foo (a,b) VALUES (1,2);
INSERT 0 1

INSERT INTO foo (a,b) SELECT  1,2;
INSERT 0 1

Cheers,
Ken





--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

[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