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

Поиск
Список
Период
Сортировка
От Leon
Тема Re: [BUGS] 'Default' troubles again. This time with time :)))
Дата
Msg-id 379200EB.B020F210@udmnet.ru
обсуждение исходный текст
Ответ на Re: [BUGS] 'Default' troubles again. This time with time :)))  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [BUGS] 'Default' troubles again. This time with time :)))
Список pgsql-bugs
Tom Lane wrote:

>
> > [ default value doesn't change over time ]
>
> This oughta be in the FAQ I think ...
>
> When you write a simple constant default, it gets coerced to the target
> data type before the default information is stored.  So, what you
> effectively did was to create table dd with a default value for gg
> of the time at which you executed 'create table'.
>

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! :)))


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

It is complete puzzle to me why 'USER' is cacheable and 'CURRENT_TIMESTAMP'
is not. This distinction, I think, should be made clearer. Maybe in
the sensible form of two-column table in the docs. :) One column is
function name, the other is 'cacheability'.

--
Leon.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] 'Default' troubles again. This time with time :)))
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] 'Default' troubles again. This time with time :)))