Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2535B475B99 for ; Tue, 19 Nov 2002 23:42:57 -0500 (EST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by postgresql.org (Postfix) with ESMTP id A0B60475B8E for ; Tue, 19 Nov 2002 23:42:56 -0500 (EST) Received: from tokyo.samurai.com (DU150.N224.ResNet.QueensU.CA [130.15.224.150]) by bob.samurai.com (Postfix) with ESMTP id DCD881DD4; Tue, 19 Nov 2002 23:42:59 -0500 (EST) To: Tom Lane Cc: David Wheeler , pgsql-hackers@postgreSQL.org Subject: Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL) References: <118.1037638710@sss.pgh.pa.us> From: Neil Conway In-Reply-To: <118.1037638710@sss.pgh.pa.us> Date: 19 Nov 2002 23:42:57 -0500 Message-ID: <8765uskg1a.fsf@mailbox.samurai.com> Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/807 X-Sequence-Number: 32023 Tom Lane writes: > Thinking about this, it occurs to me that there's no good reason why > we couldn't allow parameter symbols ($n) to be considered type UNKNOWN > initially. Good idea. > This form of PREPARE would presumably need some way of reporting back > the types it had determined for the symbols; anyone have a feeling for > the appropriate API for that? Why would this be needed? Couldn't we rely on the client programmer to know that '$n is of type foo', and then pass the appropriately-typed data to EXECUTE? If we *do* need an API for this, ISTM that by adding protocol-level support for PREPARE/EXECUTE, this shouldn't be too difficult to do (and analogous to the way we pass back type information for SELECT results). It would also allow us to side-step the parser for EXECUTE parameters, which was something that a few people had requested earlier. Cheers, Neil -- Neil Conway || PGP Key ID: DB3C29FC