Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4933F9F9A45 for ; Tue, 28 Aug 2007 14:30:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 90560-04 for ; Tue, 28 Aug 2007 14:29:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 98F979F9A59 for ; Tue, 28 Aug 2007 14:29:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l7SHTtxW029465; Tue, 28 Aug 2007 13:29:55 -0400 (EDT) To: "Brijesh Shrivastav" cc: pgsql-interfaces@postgresql.org Subject: Re: Issue with PQdescribePortal to describe a select cursor In-reply-to: <5774D66D5EC83645A99B3A905527BB7102933EE5@zipwire.esri.com> References: <5774D66D5EC83645A99B3A905527BB7102933EE5@zipwire.esri.com> Comments: In-reply-to "Brijesh Shrivastav" message dated "Tue, 28 Aug 2007 10:10:21 -0700" Date: Tue, 28 Aug 2007 13:29:55 -0400 Message-ID: <29464.1188322195@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/17 X-Sequence-Number: 6611 "Brijesh Shrivastav" writes: > Please see the test program below that creates a table and then > queries it using DECLARE CURSOR statement. Well, you only prepared the DECLARE CURSOR command, you didn't execute it --- so there's no cursor, only a prepared statement sitting waiting to be used. Once you execute the DECLARE CURSOR, you should be able to describe its portal in advance of fetching any rows from it. Or is that not what you wanted? > ... (in many > cases I need input bind parameter data from client application > before executing the query). I think you might be looking for Describe Statement (on a prepared statement) rather than Describe Portal. You have to have already provided parameter values in order to have a portal at all... regards, tom lane