Re: How to return a record set from function. - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: How to return a record set from function.
Date
Msg-id 20030827080844.D68510-100000@megazone.bigpanda.com
Whole thread Raw
In response to How to return a record set from function.  ("Kumar" <sgnerd@yahoo.com.sg>)
List pgsql-sql
On Wed, 27 Aug 2003, Kumar wrote:

> Dear Friends,
>
> I am newbie to Postgres. I am running 7.3.4 on Linux 7.3. I am using
> Pgadmin tool. I need to return the table rows via record set.
>
> Create table t1 (c1 int, c2 varchar, c3 varchar);
>
> Create or Replace function sel_t1 () returns setof records as '

Why not setof t1?

> select c1, c2, c3 from t1;
> ' Language SQL;
>
> It was fine and created a function. while i execute it as
>
> select sel_t1;

You probably want
select *   from sel_t1() as tab(c1 int, c2 varchar, c3 varchar)
(if you return setof record)

or

select * from sel_t1();
(if you return setof t1)



pgsql-sql by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Canceling other backend's query
Next
From: Bruce Momjian
Date:
Subject: Re: Canceling other backend's query