How to use the "setof" of CREATE FUNCTION

From: Fabien Thiriet <fabien(at)freever(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: andre(at)freever(dot)com
Subject: How to use the "setof" of CREATE FUNCTION
Date: 2000-08-30 16:05:56
Message-ID: 4.1.20000830165557.00c8c100@pop.imaginet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Mascari 2000-08-30 16:32:45 Re: Backend-internal SPI operations
Previous Message Mike Mascari 2000-08-30 16:03:15 Re: Backend-internal SPI operations