Re: Odd behavior with 'currval'

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Odd behavior with 'currval'
Дата
Msg-id CA+bJJbwenw_9TErFhuNxUz4T-FdVkPgTFOwL=pmFR+eegAnfWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Odd behavior with 'currval'  (Steven Hirsch <snhirsch@gmail.com>)
Ответы Re: Odd behavior with 'currval'  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Thu, Feb 8, 2018 at 8:12 PM, Steven Hirsch <snhirsch@gmail.com> wrote:
.....

> 2. Why is the currval() function being so blasted dumb?  If
> 'pg_get_serial_sequence' cannot resolve the sequence, it returns NULL. As
> such, shouldn't the outer currval() also be returning NULL?  I cannot
> imagine a rationale for the current behavior.

Are you sure it does ?  http://sqlfiddle.com/#!17/9eecb/9696 shows it
returning null. ( as expected, if it is defined strict as it should
and someone has already pointed it ).

Are you sure you are not using pgAdmin or a similar thing which
displays null as 0 in a numeric field?



Francisco Olarte.


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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: DOW is 0-based?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Odd behavior with 'currval'