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 3F4D852C9A for ; Mon, 18 Jul 2005 10:59:26 -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 14948-08 for ; Mon, 18 Jul 2005 13:59:21 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id DA8D452A3C for ; Mon, 18 Jul 2005 10:59:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j6IDwiSQ002840; Mon, 18 Jul 2005 09:58:44 -0400 (EDT) To: Richard Jones Cc: pgsql-interfaces@postgresql.org Subject: Re: Parse a statement, get parameter types and return types In-reply-to: <20050718130337.GA23201@furbychan.cocan.org> References: <20050718130337.GA23201@furbychan.cocan.org> Comments: In-reply-to Richard Jones message dated "Mon, 18 Jul 2005 14:03:37 +0100" Date: Mon, 18 Jul 2005 09:58:44 -0400 Message-ID: <2839.1121695124@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/29 X-Sequence-Number: 5665 Richard Jones writes: > Given a statement, eg: > select foo from bar where col = $1 > I'd really like to get the types deduced by the PostgreSQL parser for > the input variables ($1, etc.) and the result column(s). 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 :-( regards, tom lane