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

From Fernando Papa
Subject Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Date
Msg-id CB94A4924490EC4A81EDA55BA378B7BAFE7990@exch2k01.buehuergo.corp.claxson.com
Whole thread Raw
In response to LIMIT/OFFSET doesn't work on PL/PGSQL  ("Fernando Papa" <fpapa@claxson.com>)
List pgsql-general
I resolved the LIMIT/OFFSET problem... I put all the query into a
variable and then, OPEN for EXECUTE... is not the best for the
performance I think, but it's work!

Thanks!

--
Fernando O. Papa
DBA


> -----Mensaje original-----
> De: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Enviado el: viernes, 14 de marzo de 2003 19:28
> Para: Fernando Papa
> CC: pgsql-general@postgresql.org
> Asunto: Re: [GENERAL] LIMIT/OFFSET doesn't work on PL/PGSQL
>
>
> "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: Tom Lane
Date:
Subject: Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Next
From: Abdul-wahid Paterson
Date:
Subject: query optimisation