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

From: "Fernando Papa" <fpapa(at)claxson(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: LIMIT/OFFSET doesn't work on PL/PGSQL
Date: 2003-03-14 23:20:35
Message-ID: CB94A4924490EC4A81EDA55BA378B7BAFE7990@exch2k01.buehuergo.corp.claxson.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us]
> Enviado el: viernes, 14 de marzo de 2003 19:28
> Para: Fernando Papa
> CC: pgsql-general(at)postgresql(dot)org
> Asunto: Re: [GENERAL] LIMIT/OFFSET doesn't work on PL/PGSQL
>
>
> "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
>

Browse pgsql-general by date

  From Date Subject
Next Message Abdul-wahid Paterson 2003-03-15 01:09:10 query optimisation
Previous Message Tom Lane 2003-03-14 22:27:37 Re: LIMIT/OFFSET doesn't work on PL/PGSQL