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

From Tom Lane
Subject Re: Should we document how column DEFAULT expressions work?
Date
Msg-id 1437009.1719378777@sss.pgh.pa.us
Whole thread Raw
In response to Re: Should we document how column DEFAULT expressions work?  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Should we document how column DEFAULT expressions work?
Re: Should we document how column DEFAULT expressions work?
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> If people don't properly understand these special timestamp input
> values, then maybe the documentation in [1] needs to be improved.  At
> the moment the details are within parentheses. Namely "(In particular,
> now and related strings are converted to a specific time value as soon
> as they are read.)".  Maybe it would be better to be more explicit
> there and mention that these are special values that the input
> function understands which are translated to actual timestamp values
> when the type's input function is called.  That could maybe be tied
> into the DEFAULT clause documentation to mention that the input
> function for constant values is called at DML time rather than DDL
> time.  That way, we're not adding these (unsustainable) special cases
> to the documentation.

This sounds like a reasonable approach to me for the
magic-input-values issue.  Do we want to do anything about
nextval()?  I guess if you hold your head at the correct
angle, that's also a magic-input-value issue, in the sense
that the question is when does regclass input get resolved.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "M, Anbazhagan"
Date:
Subject: Reg: Alternate way of hashing database role passwords
Next
From: "David G. Johnston"
Date:
Subject: Re: Should we document how column DEFAULT expressions work?