Re: Assigning Values to Composite Types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Assigning Values to Composite Types
Дата
Msg-id 11871.1256236117@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Assigning Values to Composite Types  (Gary Chambers <gwchamb@gmail.com>)
Список pgsql-sql
Gary Chambers <gwchamb@gmail.com> writes:
>         /* Here is where I am stuck trying to fill data
>            I've tried:

>            data.term_count.coord_type := S;
>            (data.term_count).coord_type := S;
>            data.(term_count.coord_type) := S;
>         */

I'm afraid plpgsql isn't tremendously bright about such cases.  If
you have all the values available at once, though, it seems like
you should be able to do
data.term_count := row(this, that, the_other);

An explicit cast of the row() construct to the target column's type
might be a good idea --- I think it would work without, but probably
not with good performance.
        regards, tom lane


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

Предыдущее
От: Gary Chambers
Дата:
Сообщение: Assigning Values to Composite Types
Следующее
От: the6campbells
Дата:
Сообщение: question about timestamp with tz