Search Postgresql Archives

Re: How do I insert and update into a table of arrays of composite types via a select command?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 25, 2017 at 2:16 PM, Celia McInnis <celia.mcinnis@xxxxxxxxx> wrote:
Got it, finally...

insert into t_array select array[row((data_comp).*)::mytype[] from t_composite;

I'm not sure why I need (data_comp).* rather than some of the other things that I tried and failed with...


​The ​unusual set of parentheses are so the parser interprets data_comp is a column and not a table. Usually one write SELECT tbl.* FROM tbl so that is the assumed meaning of "name".*

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux