Re: Should we document how column DEFAULT expressions work?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Should we document how column DEFAULT expressions work?
Дата
Msg-id 1642803.1719447063@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Should we document how column DEFAULT expressions work?  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Should we document how column DEFAULT expressions work?
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> Maybe I'm slow on the uptake, but I've yet to see anything here where
> time literals act in a special way DEFAULT constraints. This is why I
> couldn't understand why we should be adding documentation about this
> under CREATE TABLE.

It's not that the parsing rules are any different: it's that in
ordinary DML queries, it seldom matters very much whether a
subexpression is evaluated at parse time versus run time.
In CREATE TABLE that difference is very in-your-face, so people
who haven't understood the rules clearly can get burnt.

However, there are certainly other places where it matters,
such as queries in plpgsql functions.  So I understand your
reluctance to go on about it in CREATE TABLE.  At the same
time, I see where David J. is coming from.

Maybe we could have a discussion of this in some single spot,
and link to it from CREATE TABLE and other relevant places?
ISTR there is something about it in the plpgsql doco already.

            regards, tom lane



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Should we document how column DEFAULT expressions work?
Следующее
От: David Rowley
Дата:
Сообщение: Re: Should we document how column DEFAULT expressions work?