Re: Rowtype column and domain subfield with DEFAULT and NOT NULL constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rowtype column and domain subfield with DEFAULT and NOT NULL constraint
Дата
Msg-id 11415.1394633781@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Rowtype column and domain subfield with DEFAULT and NOT NULL constraint  (Julien Tachoires <julien.tachoires@dalibo.com>)
Ответы Re: Rowtype column and domain subfield with DEFAULT and NOT NULL constraint  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Julien Tachoires <julien.tachoires@dalibo.com> writes:
> A customer has reported us a strange behaviour regarding a rowtype 
> column with a domain subfield:

Rowtypes in general do not support defaults for component fields.

> Is build_column_default() the right place to handle that case ?

It's unlikely that this is simple to change.  As an example, should
the default be inserted during a cast to the rowtype?  How about
plpgsql variable initialization?  What are you going to do about
scalar-NULL values of the rowtype (note "forbid them" is likely
to cause all sorts of collateral damage)?

But in any case, none of the examples you showed have anything to
do with build_column_default().  That would only get applied if
the INSERT's targetlist didn't mention col1 at all.
        regards, tom lane



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

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: pgstat wait timeout (RE: contrib/cache_scan)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgstat wait timeout (RE: contrib/cache_scan)