select from composite type

Поиск
Список
Период
Сортировка
От Lorusso Domenico
Тема select from composite type
Дата
Msg-id CAJMpnG4nv+itZ8SA5R0MPevOtnzkNaRhCuFcZk+hZR7UzHdD9g@mail.gmail.com
обсуждение исходный текст
Ответы Re: select from composite type
Список pgsql-general
Hello guys,
I'm trying to find out the equivalent behaviour of unnest, when I've got just a composite type.

This is the statement is something like that (but more complex):

 _sqlUpdate text=$$
with s as (
select * from ($1)
)  
update myView as q set
(attribute_fullname, modify_user_id)
=(s.attribute_fullname, $2)
where  s.product_code=q.product_code
and s.attribute_uid=q.attribute_uid
$$;

And I use this command.
execute _sqlUpdate using  attribute_list[_i], _modify_user_id;

attribute_list is  an array of composite type (with 20 fields).

If I use the unnest with the entire array the sql works, but I can't find a way to treat the single record as a row of  a table.


Any suggestions?

Bye and thanks'

Domenico

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

Предыдущее
От: veem v
Дата:
Сообщение: Question on partitioning
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: How to do faster DML