Re: forcing returned values to be binary

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: forcing returned values to be binary
Date: 2005-11-14 05:12:05
Message-ID: 2175.1131945125@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dave Cramer <pg(at)fastcrypt(dot)com> writes:
> I was thinking that it may be necessary to issue a describe before
> the execute, but I'm thinking now that the driver can only handle
> specific types, so anything outside of what it knows about would be
> an error anyway.

> I gather it's not possible to mix the return format? For example all
> known types would be binary, others would be text ? At this point I'm
> not even sure it would help.

You can ask for mixed return formats; see the description of the Bind
message. The sticky spot is that you can't really do that without first
having gotten the list of output columns (via Describe Statement).
Without that, you don't even know how many output columns there are,
let alone which ones have datatypes you understand.

I'm not sure that this is a fatal objection, at least not for
prepared-in-advance statements. You can put a Describe Statement into
the same network packet exchange as the original Parse message, so
there isn't any reason that you can't know the column types. It is
problematic if you want to Parse/Bind/Execute in just one round trip.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2005-11-14 07:15:09 PostgreSQL Weekly News - November 13 2005
Previous Message Dave Cramer 2005-11-14 04:24:40 Re: forcing returned values to be binary