Search Postgresql Archives

arrays of rows and dblink

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

 



Hi,

we have the ROW type and we have arrays. We also can create arrays of
rows like:

select array_agg(r)
  from (values (1::int, 'today'::timestamp, 'a'::text),
               (2, 'yesterday', 'b')) r(a,b,c);
                             array_agg
-------------------------------------------------------------------
 {"(1,\"2014-04-30 00:00:00\",a)","(2,\"2014-04-29 00:00:00\",b)"}


Now I want to execute that query via dblink on a remote server. How do I
specify the result type?

select tb.* from dblink( 'dbname=postgres', $$
    select array_agg(r)
      from (values (1::int, 'today'::timestamp, 'a'::text),
$$) tb( WHAT DO I PUT HERE? )

Thanks,
Torsten


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[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