X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4815F9FA465 for ; Tue, 12 Sep 2006 09:35:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 37288-07 for ; Tue, 12 Sep 2006 09:34:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id 667A09FA435 for ; Tue, 12 Sep 2006 09:34:58 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so2626725pyd for ; Tue, 12 Sep 2006 05:34:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=EqwOQsSx+vq2vvRj0ITAwj0hEvUVZi85CyhEXQKu170xrGzRSSakc6vYFfAx3mMot3oPm2Ld12CqpUWVyaUlggK3ajhVCWspFyqVtiz5OfvRgadoDLjon1UZZXSaW0/DyX+3YrWV22Fr3Nmezk9v2Xis8iI8HzG18XRlEJRQ2Og= Received: by 10.35.40.10 with SMTP id s10mr10766536pyj; Tue, 12 Sep 2006 05:34:53 -0700 (PDT) Received: by 10.35.115.8 with HTTP; Tue, 12 Sep 2006 05:34:53 -0700 (PDT) Message-ID: Date: Tue, 12 Sep 2006 14:34:53 +0200 From: Andro To: "Jeroen T. Vermeulen" Subject: Re: cursors on prepared queries Cc: pgsql-interfaces@postgresql.org In-Reply-To: <24793.125.24.222.234.1158058065.squirrel@webmail.xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3030_28450675.1158064493697" References: <24793.125.24.222.234.1158058065.squirrel@webmail.xs4all.nl> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.595 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/4 X-Sequence-Number: 6249 ------=_Part_3030_28450675.1158064493697 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I just found this interesting link http://lists.initd.org/pipermail/psycopg/2005-October/003999.html about psycopg python interface which looks like able to make the use of prepared statements within cursors. That means the protocol handles it but not libpq, right? What should we - libpq users - do? Keep trickin' or .. start pachin'? :) Charles On 9/12/06, Jeroen T. Vermeulen wrote: > > On Tue, September 12, 2006 17:18, Andro wrote: > > > PREPARE plan_name(int) AS SELECT * FROM abc WHERE a = $1; > > DECLARE cur CURSOR FOR EXECUTE(3); > > (You'd probably also want to mention the name of the prepared statement > that you're executing somewhere :) > > > 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". > > Well, the documentation for DECLARE says that the query that cursor > executes must be a "SELECT command"--not that I personally know the > reasons behind it: > > http://www.postgresql.org/docs/8.1/interactive/sql-declare.html > > > Jeroen > > > ------=_Part_3030_28450675.1158064493697 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I just found this interesting link http://lists.initd.org/pipermail/psycopg/2005-October/003999.html
about psycopg python interface which looks like able to make the use of prepared statements within cursors.

That means the protocol handles it but not libpq, right?

What should we - libpq users - do? Keep trickin' or .. start pachin'? :)

Charles

On 9/12/06, Jeroen T. Vermeulen <jtv@xs4all.nl> wrote:
On Tue, September 12, 2006 17:18, Andro wrote:

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

(You'd probably also want to mention the name of the prepared statement
that you're executing somewhere :)

> 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".

Well, the documentation for DECLARE says that the query that cursor
executes must be a "SELECT command"--not that I personally know the
reasons behind it:

http://www.postgresql.org/docs/8.1/interactive/sql-declare.html


Jeroen



------=_Part_3030_28450675.1158064493697--