Search Postgresql Archives

Re: Blank, nullable date column rejected by psql

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

 




Ken,

Well, you've succeeded in confusing me. :-)

And this is the framwork for adding rows:

insert into Activities (person_id,act_date,act_type,notes,next_contact) values
(

I add values for each column, but if there's no scheduled next_contact date
I left that off. To me, this looks like your second example (with two
columns of values and no date) and I don't see the differences.

Assuming you're meaning this example:

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

The difference is I didn't specify field c in the list of columns, so it gets inserted with its default value.  That would be the same as:

insert into Activities (person_id,act_date,act_type,notes) values...

Now that will work if you're doing a separate INSERT for each row.  If you're doing multiple VALUES in one select, and some have a next contact date and some don't, then I think you're going to need to explicitly spell out your NULLs.

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