From: | "Robert Turnbull" <rturnbull(at)strategicmind(dot)com> |
---|---|
To: | "Christoph Haller" <ch(at)rodos(dot)fzk(dot)de> |
Cc: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Prepared select |
Date: | 2004-04-19 00:48:16 |
Message-ID: | 002b01c425a8$009d78b0$7e02a8c0@robert |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
There are several production issues related to the proposed solution. For
example, what happens when the result set exceeds the swap space of the
server or client machine? My original question is how to get a cursor from a
prepared select so a subset of the result can be returned to the client for
processing. For your solution to work the SQL EXECUTE command needs the
functionality of the SQL FETCH command.
> >
> >
> > How can I use a prepared select statement as mentioned in the
documentation=
> > on SQL PREPARE. Preparing the statement is easy, the problem is using
the =
> > plan to get a cursor. My assumption is the SQL OPEN command is not
document=
> > ed or there is some other libpq API to make this happen.
> >
> > Thanks
> >
> >
> >
> I'm using libpq and lines like below are working:
>
> res = PQexec(conn,
> "PREPARE plan001 ( integer , double precision , character ) AS SELECT
a,b,d FROM foo WHERE a = $1 OR d > $2 OR b = $3");
> ...
> res = PQexec(conn, "EXECUTE plan001 ( 3 , 6.66 , 'whatever' ) ");
>
> HTH, pretty late reply - I know (but no one else did as far as I can tell)
>
> Regards, Christoph
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2004-04-19 05:19:30 | ON COMMIT DROP |
Previous Message | Tom Lane | 2004-04-18 18:26:55 | Re: Regression from 7.3 to 7.4 |