pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andro <andromede@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: cursors on prepared queries
Date: Tue, 12 Sep 2006 12:18:39 +0200
Message-ID: <da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com> (raw)

Hi,

there isn't any interface for using cursors within libpq, I'll do with a
PQexec(conn,"DECLARE..."); and fetch.
Now I'd like to know if it's possible to prepare a query (that takes forever
to plan) and execute it into a cursor, like (SQL) :

PREPARE plan_name(int) AS SELECT * FROM abc WHERE a = $1;
DECLARE cur CURSOR FOR EXECUTE(3);

doing so, I get a 'syntax error at or near "EXECUTE" at character 24'

Is something wrong or is it just not supported by postgres?
Manual talks about read only cursors but I didn't find out discussions about
"anti-prepared-statement-cursors".

I'm using postgres-8.1.4.

Any help appreciated!

Thanks

Charles

view thread (4+ messages)  latest in thread

Message-ID: <da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com>
Permalink:  ../da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com/
Also on:    postgresql.org/message-id/da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: andromede@gmail.com
  Subject: Re: cursors on prepared queries
  In-Reply-To: <da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox