Re: Fwd: Proper query implementation for Postgresql driver - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fwd: Proper query implementation for Postgresql driver
Date
Msg-id 31640.1412058467@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fwd: Proper query implementation for Postgresql driver  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
[ too tired to respond to the other points, but: ]

Shay Rojansky <roji@roji.org> writes:
>> It's also possible for a type not to have send/recv functions, i.e. to
>> support text-only use.

> In that case, what would be the behavior of selecting such a type with an
> extended query that specifies "all results in binary"? A PG error?

Yup.
   if (!OidIsValid(pt->typsend))       ereport(ERROR,               (errcode(ERRCODE_UNDEFINED_FUNCTION),
errmsg("no binary output function available for type %s",                       format_type_be(type))));
 

There's an exactly parallel error if you try to send a parameter in
binary when its datatype hasn't got a typreceive function.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Re: Fwd: Proper query implementation for Postgresql driver
Next
From: Kouhei Kaigai
Date:
Subject: Re: [v9.5] Custom Plan API