Re: PostgreSQL Functions / PL-Language

From: "Jan Cruz" <malebug(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Functions / PL-Language
Date: 2006-02-20 06:36:04
Message-ID: 493da2780602192236k1d9332e2jdb803cefe00b9efb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/19/06, Michael Fuhr <mike(at)fuhr(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-02-20 07:07:11 Re: PostgreSQL Functions / PL-Language
Previous Message Chris 2006-02-20 04:03:57 simple explain output.