How to use the "setof" of CREATE FUNCTION - Mailing list pgsql-hackers

From Fabien Thiriet
Subject How to use the "setof" of CREATE FUNCTION
Date
Msg-id 4.1.20000830165557.00c8c100@pop.imaginet.fr
Whole thread Raw
Responses Re: How to use the "setof" of CREATE FUNCTION  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,
 I am trying to use the CREATE FUNCTION in order to process multiple
calculation, and forward at the end multiple instances.

This is the SQL statement I am using:

CREATE FUNCTION foo(varchar) RETURNS setof myTable
AS 'UPDATE .......;
INSERT.......;
SELECT myTable.field2 from myTable'
LANGUAGE 'sql';

I always get an error saying that there is a type mismatch between what is
behing the "setof" and what is return by this function (myTable.field2)


Any idea?

(Note: I am using postgresql 7.02)

Fabien




pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Backend-internal SPI operations
Next
From: Tom Lane
Date:
Subject: Re: Backend-internal SPI operations