Re: When should parameters be passed as text v. binary? - Mailing list pgsql-general

From Andrew Gierth
Subject Re: When should parameters be passed as text v. binary?
Date
Msg-id 87blrjktdo.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to When should parameters be passed as text v. binary?  (Paula Kirsch <pl.kirsch@gmail.com>)
Responses Re: When should parameters be passed as text v. binary?
List pgsql-general
>>>>> "Paula" == Paula Kirsch <pl.kirsch@gmail.com> writes:

 Paula> I'm just trying to understand the trade-offs between sending
 Paula> everything always as text, all integer parameters as binary,
 Paula> floats as binary, etc.

For passing data from client to server, there's no particular reason not
to use the binary format for any data type that you understand (and
where you're passing the data type oid explicitly in the query, rather
than just leaving it as unknown).

For results, things are harder, because libpq is currently
all-or-nothing about result type formats, and if you start using
extension types then not all of them even _have_ a binary format. And to
decode a binary result you need to know the type, and have code to
handle every specific type's binary format.

-- 
Andrew (irc:RhodiumToad)



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Undeliverable: Re: Changing default ../data/ directory (fwd)
Next
From: Justin
Date:
Subject: Re: When should parameters be passed as text v. binary?