Re: Blank, nullable date column rejected by psql

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

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.

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Blank, nullable date column rejected by psql
Следующее
От: github kran
Дата:
Сообщение: Re: Aurora Postgresql RDS DB Latency