Re: Virtual generated columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Virtual generated columns
Дата
Msg-id 1662507.1736354338@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Virtual generated columns  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: Virtual generated columns
Список pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> On 03.12.24 15:15, jian he wrote:
>> SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE
>> attgenerated IN ('v') and (attnotnull or not atthasdef);

> I don't understand what the purpose of testing attnotnull is.  That is 
> independent of attgenerated, I think.

Does it make any sense to set NOT NULL on a generated column (virtual
or otherwise, but especially virtual)?  What is the system supposed
to do if the expression evaluates to null?  That concern generalizes
to any constraint really.  Even if we checked it at row storage time,
there's no real guarantee that the expression is immutable enough
to pass the constraint later.

            regards, tom lane



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