Re: insert into: NULL in date column

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: insert into: NULL in date column
Дата
Msg-id CAKFQuwa-Wnz0h3S=_zHWDc5JdnR+9vv1N9FD_-jt-J0kWAR0Zg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: insert into: NULL in date column  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On Fri, Jan 11, 2019 at 4:25 PM Rob Sargent <robjsargent@gmail.com> wrote:
> We don't have more context in "activities.sql" but if your OP was
> verbatim, it's keeling over on the comma ending the long text string.
> Something syntactically askew I think.

If the problem was where you described the parser would never have
gotten to the point of trying to pass an empty string to a date
constructor resulting in a runtime error.  It would have failed at
compile time with a very different error probably relating to
"malformed statement" or "unexpected identifier".

The OP provided sufficient detail (though an actual complete failing
command would have been nice) to pinpoint the misunderstanding that
the empty string and null are not the same thing at that converting
the empty string to a date is not possible (i.e., it doesn't just
silently return null for invalid input, one must pass in null
explicitly if one wishes to construct a date typed null.)

David J.


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: insert into: NULL in date column
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: insert into: NULL in date column