Re: LIMIT/OFFSET doesn't work on PL/PGSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fernando Papa" <fpapa(at)claxson(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Date: 2003-03-14 22:27:37
Message-ID: 24131.1047680857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Fernando Papa" <fpapa(at)claxson(dot)com> writes:
> I don't know why the last query doesn't work inside function... I run
> the query from psql and every goes ok, but when I use the function, I
> can't see anything (the function doesn't retrieve anything). I put fixed
> value on LIMIT and the function execute correctly.

I think the problem is passing plpgsql variables into a cursor
declaration, not limit/offset per se. You need to use the defined
syntax for cursor parameters to make that work, I believe.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Papa 2003-03-14 23:20:35 Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Previous Message Dennis Gearon 2003-03-14 22:11:59 Re: The folding of unquoted names to lower case in PostgreSQL