Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: David Wheeler <david(at)wheeler(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)
Date: 2002-11-20 05:24:55
Message-ID: 28501.1037769895@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Neil Conway <neilc(at)samurai(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-11-20 06:06:36 Geometry test on NetBSD (was Re: [HACKERS] RC1?)
Previous Message Neil Conway 2002-11-20 04:42:57 Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bruce Badger 2002-11-20 06:12:32 Re: Question about the postgresql protocol
Previous Message Neil Conway 2002-11-20 04:42:57 Re: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)