Re: Should we document how column DEFAULT expressions work? - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Should we document how column DEFAULT expressions work?
Date
Msg-id CAKFQuwY1XLR4Xfd6TLE4p1Ks=PNKvncTc19i5FfgngG+Pg5-Eg@mail.gmail.com
Whole thread Raw
In response to Re: Should we document how column DEFAULT expressions work?  (David Rowley <dgrowleyml@gmail.com>)
List 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 by date:

Previous
From:
Date:
Subject: RE: Improve EXPLAIN output for multicolumn B-Tree Index
Next
From: "David G. Johnston"
Date:
Subject: Re: Should we document how column DEFAULT expressions work?