Re: Blank, nullable date column rejected by psql

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: Blank, nullable date column rejected by psql
Дата
Msg-id CAD3a31Ui0HXAmNSEOHdZW1-TkZZStcuZ+Zb+BiFN7cox7Qth3g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Blank, nullable date column rejected by psql  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general

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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Blank, nullable date column rejected by psql
Следующее
От: Ron
Дата:
Сообщение: Re: Blank, nullable date column rejected by psql