From: Tom Lane <tgl@sss.pgh.pa.us>
To: Neil Conway <neilc@samurai.com>
Cc: David Wheeler <david@wheeler.net>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)
Date: Wed, 20 Nov 2002 00:24:55 -0500
Message-ID: <28501.1037769895@sss.pgh.pa.us> (raw)
In-Reply-To: <8765uskg1a.fsf@mailbox.samurai.com>
References: <A3F94BB8-FB12-11D6-93B3-0003931A964A@wheeler.net>
<118.1037638710@sss.pgh.pa.us>
<8765uskg1a.fsf@mailbox.samurai.com>
Neil Conway <neilc@samurai.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> 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?
I don't think so. You may as well ask why we waste bandwidth on passing
back info about the column names and types of a SELECT result ---
shouldn't the client know that already? There are lots of middleware
layers that don't know it, or at least don't want to expend a lot of
code on trying to deduce it.
> 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).
I'm not sure what you mean by protocol-level support, but the one idea
I had was to return a table (equivalent to a SELECT result) listing
the parameter types. This would not break libpq, for example, so
arguably it's not a protocol change. But if you think the recent
changes in how EXPLAIN returns its results are a protocol change, then
yeah it's a protocol change ...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, neilc@samurai.com, david@wheeler.net, pgsql-hackers@postgreSQL.org
Subject: Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)
In-Reply-To: <28501.1037769895@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox