Error in returning setof records

Started by Anjaliabout 20 years ago2 messagesbugs
Jump to latest
#1Anjali
anjalia@cdac.in

Hi all,
when i am returning function as setof record then it will give error
"ERROR: set-valued function called in context that cannot accept a set
CONTEXT: PL/pgSQL function "gfs_ls" while casting return value to
function's return type"

plz help me to get rid of it

--
With Regards,
Anjali Arora
Project Engineer
Hardware Technology And Development Group
Center for Development of Advanced Computing
Pune University Campus,Ganeshkhind
Pune-411007
Tel: 020-25704320
Mob: 09372441025
Web: www.cdac.in

#2Richard Huxton
dev@archonet.com
In reply to: Anjali (#1)
Re: Error in returning setof records

Anjali Arora wrote:

Hi all,
when i am returning function as setof record then it will give error
"ERROR: set-valued function called in context that cannot accept a set
CONTEXT: PL/pgSQL function "gfs_ls" while casting return value to
function's return type"

This is not a bug - see the manuals for details.

A set returning function is like a table so you need to call it as:
SELECT * FROM my_set_function();

For general help you might like to try the general/sql mailing lists
rather than the bug tracker.
--
Richard Huxton
Archonet Ltd