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 Tom Lane <tgl@sss.pgh.pa.us>
Re: Rowtype column and domain subfield with DEFAULT and NOT NULL constraint Michael Paquier <michael.paquier@gmail.com>
Julien Tachoires  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
Дата:
От: Tom Lane
Дата:
FAQ