Re: Should we document how column DEFAULT expressions work?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Should we document how column DEFAULT expressions work?
Дата
Msg-id CAKFQuwY1XLR4Xfd6TLE4p1Ks=PNKvncTc19i5FfgngG+Pg5-Eg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Should we document how column DEFAULT expressions work?  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
On Sun, Jun 30, 2024 at 7:52 PM David Rowley <dgrowleyml@gmail.com> wrote:
On Mon, 1 Jul 2024 at 13:41, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> I presume the relatively new atomic SQL functions pose a similar hazard.

Do you have an example of this?


create function testnow() returns timestamptz language sql
return 'now'::timestamptz;

select testnow();
select pg_sleep(5);
select testnow(); -- same time as the first call

Which conforms with the documentation and expression parsing rules for literals:

"This form is parsed at function definition time, the string constant form is parsed at execution time;..."

David J.

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