Re: select as params to function - Mailing list pgsql-general

From Pavel Stehule
Subject Re: select as params to function
Date
Msg-id CAFj8pRAD1xUj4LH99knnHdvh7_TYpfECZfxH-ypQMwFi3oitEw@mail.gmail.com
Whole thread Raw
In response to select as params to function  (Andy Colson <andy@squeakycode.net>)
Responses Re: select as params to function
List pgsql-general
Hello

PostgreSQL has no table data type. You can use a array of records instead

and then

select fx((select array(select * from tab)));

regards

Pavel Stehule

2012/2/17 Andy Colson <andy@squeakycode.net>:
> Hi all,
>
> Trying to clean up some data so I wrote myself a function which will insert
> the new stuff okay but the existing data... I'm not sure how to run it
> through the function.
>
> To make life a little simpler on myself, the old data is in table webserv2
> and the new data will go into table webserv2a.
>
> The function insert_webserv2 takes the old arguments, cleans things up, and
> inserts into webserv2a.
>
> All is well there.  But I have a table full of stuff in webserv2 that I'd
> like moved over.
>
> I'd love to do:
>
> select insert_webserv2( (select * from webserv2) );
>
> but that obviously wont work.  Is there a simple way to feed a table through
> the function?
>
> -Andy
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Jayashankar K B
Date:
Subject: Postgres 9.1 package for i.MX51X processor from Freescale
Next
From: Andy Colson
Date:
Subject: Re: select as params to function