Re: [BUGS] 'Default' troubles again. This time with time :)))

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] 'Default' troubles again. This time with time :)))
Дата
Msg-id 12650.932328670@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] 'Default' troubles again. This time with time :)))  (Leon <leon@udmnet.ru>)
Список pgsql-bugs
Leon <leon@udmnet.ru> writes:
> Tom! I tested your method of creating table with
> create table ww (aa int4, bb timestamp default text 'now'),
> and it didn't work either! (BTW, this is exactly the way docs suggest
> doing it.)  See? I promised to deliver a real bug and I did it! :)))

By golly, you're right.  It works as advertised for a DATETIME field,
which is the case I'd been testing.  But for a TIMESTAMP field the
constant gets pre-coerced anyway :-(.  Wonder why ... will look into
it, since I'm busy hacking on that part of the system now.

> Yes, docs mumble something about 'cacheable' and 'non-cacheable'
> functions, but it is not clear to me how Postgres discerns them.

The proiscachable field in table pg_proc is presumably supposed to
tell this.  Doesn't look like it's set in an intelligent manner
for most of the built-in functions though.  I don't think it has
anything to do with the bug for TIMESTAMP...

            regards, tom lane

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

Предыдущее
От: Leon
Дата:
Сообщение: Re: [BUGS] 'Default' troubles again. This time with time :)))
Следующее
От: Unprivileged user
Дата:
Сообщение: General Bug Report: psql does report failed SQL commands as executed