Re: PostgreSQL Functions / PL-Language - Mailing list pgsql-general

From Jan Cruz
Subject Re: PostgreSQL Functions / PL-Language
Date
Msg-id 493da2780602192236k1d9332e2jdb803cefe00b9efb@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL Functions / PL-Language  (Michael Fuhr <mike@fuhr.org>)
Responses Re: PostgreSQL Functions / PL-Language  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general


On 2/19/06, Michael Fuhr <mike@fuhr.org> wrote:
On Sat, Feb 18, 2006 at 04:48:55PM +0800, Jan Cruz wrote:

 

CREATE TABLE foo (id integer, t text);
INSERT INTO foo VALUES (1, 'one');
INSERT INTO foo VALUES (2, 'two');



Thanks for the correct syntaxing Mike.

BTW I also got something like this:

CREATE FUNCTION func2() RETURNS SETOF foo as $$
DECLARE
row foo;
BEGIN
  SELECT INTO ROW * from FOO;
   return next foo;
END;
$$ LANGUAGE plpgsql STABLE;

select * from func2();

It did return the 2 rows (all rows) when I first test it.
Then today I tried the same function  and test it then it return only 1 row.

I wonder..........

BTW, I'm using PostgreSQL 8.1.3.

pgsql-general by date:

Previous
From: Chris
Date:
Subject: simple explain output.
Next
From: Michael Fuhr
Date:
Subject: Re: PostgreSQL Functions / PL-Language