From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Alexander Farber <alexander(dot)farber(at)gmail(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Slow query: select * order by XXX desc offset 10 limit 10 |
Date: | 2011-10-14 09:30:37 |
Message-ID: | CAFj8pRA4Xy2XypoX=tfF-wsW0xvtXaEbPNKEcUx68K3V+4iA6w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello
you should to use a DECLARE statement
http://www.postgresql.org/docs/9.1/interactive/sql-declare.html
and fetch statement
http://www.postgresql.org/docs/9.1/interactive/sql-fetch.html
Regards
Pavel Stehule
2011/10/14 Alexander Farber <alexander(dot)farber(at)gmail(dot)com>:
> I've also tried opening cursor:
>
> quincy=> open ref for select to_char(qdatetime, 'YYYY-MM-DD') as
> QDATETIME,ID,NAME,CATEGORY,APPSVERSION,OSVERSION,DETAILS,DEVINFO from
> quincyview where qdatetime <= now() order by QDATETIME desc ;
> ERROR: syntax error at or near "open"
> LINE 1: open ref for select to_char(qdatetime, 'YYYY-MM-DD') as QDAT...
> ^
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Farber | 2011-10-14 09:36:50 | Re: Slow query: select * order by XXX desc offset 10 limit 10 |
Previous Message | Alexander Farber | 2011-10-14 09:27:33 | Re: Slow query: select * order by XXX desc offset 10 limit 10 |