Re: SETOF Record Problem - Mailing list pgsql-general

From A. Kretschmer
Subject Re: SETOF Record Problem
Date
Msg-id 20100119071904.GE29338@a-kretschmer.de
Whole thread Raw
In response to SETOF Record Problem  (Yan Cheng Cheok <yccheok@yahoo.com>)
List pgsql-general
In response to Yan Cheng Cheok :
> By referring to http://www.postgresql.org/docs/current/static/xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS, section
34.4.8.SQL Functions Returning TABLE 

That's for language SQL, you are using:

> CREATE OR REPLACE FUNCTION get_measurements(IN bigint)
>   LANGUAGE 'plpgsql' VOLATILE

language plpgsql. That's not the same ...


> But the example doesn't use any "INTO" or "RETURN".

Sure? Read again:
http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html

Rewrite your to RETURN <insert your select here>;


Regards, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: C: extending text search: from where to start
Next
From: "A. Kretschmer"
Date:
Subject: Re: Index on immutable function call