Re: LIMIT/OFFSET doesn't work on PL/PGSQL - Mailing list pgsql-general

From Tom Lane
Subject Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Date
Msg-id 24131.1047680857@sss.pgh.pa.us
Whole thread Raw
In response to LIMIT/OFFSET doesn't work on PL/PGSQL  ("Fernando Papa" <fpapa@claxson.com>)
List pgsql-general
"Fernando Papa" <fpapa@claxson.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

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: The folding of unquoted names to lower case in PostgreSQL
Next
From: "Fernando Papa"
Date:
Subject: Re: LIMIT/OFFSET doesn't work on PL/PGSQL