X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AEA1052848 for ; Mon, 18 Jul 2005 13:52:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98400-08 for ; Mon, 18 Jul 2005 16:52:16 +0000 (GMT) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by svr1.postgresql.org (Postfix) with ESMTP id C764752AE8 for ; Mon, 18 Jul 2005 13:52:13 -0300 (ADT) Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1DuYzS-0005mZ-00; Mon, 18 Jul 2005 18:01:14 +0100 Date: Mon, 18 Jul 2005 18:01:14 +0100 To: Tom Lane Cc: pgsql-interfaces@postgresql.org Subject: Re: Parse a statement, get parameter types and return types Message-ID: <20050718170113.GA3411@furbychan.cocan.org> References: <20050718130337.GA23201@furbychan.cocan.org> <2839.1121695124@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2839.1121695124@sss.pgh.pa.us> User-Agent: Mutt/1.3.28i From: Richard Jones X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200507/30 X-Sequence-Number: 5666 On Mon, Jul 18, 2005 at 09:58:44AM -0400, Tom Lane wrote: > This is possible at the protocol level -- see Describe Statement. > I'm not sure which client libraries let you get at the results ... > libpq isn't one of them :-( Thanks for answering my question so promptly! I've made a small patch against 8.0.3 which adds this functionality to libpq-fe. However I am not very certain of how the asynchronous stuff works in this library, so it will need careful checking. Nevertheless, it Works For Me in the limited testing I have done against a 7.4 server. http://annexia.org/tmp/PQsendDescribeStatement.diff Note the user is expected to free(3) the Oids (types) array returned by PQgetDescription. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com