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

From Kumar
Subject How to return a record set from function.
Date
Msg-id 006901c36c6b$65ab2000$7502a8c0@hdsc.com
Whole thread Raw
Responses Re: How to return a record set from function.  (Joe Conway <mail@joeconway.com>)
Re: How to return a record set from function.  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: How to return a record set from function.  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
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 '
select c1, c2, c3 from t1;
' Language SQL;
 
It was fine and created a function. while i execute it as
 
select sel_t1;
 
 I got the following error.
 
ERROR:  Cannot display a value of type RECORD
 
How to solve this. Please help.
 
Kumar

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres 7.1.3: why does the query plan ignore indexes?
Next
From: Bruce Momjian
Date:
Subject: Re: postgres 7.1.3: why does the query plan ignore indexes?