Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D80BD634045 for ; Sat, 6 Jun 2009 12:15:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 66246-04 for ; Sat, 6 Jun 2009 12:15:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5F3AE6321D6 for ; Sat, 6 Jun 2009 12:15:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n56FF2h0009705; Sat, 6 Jun 2009 11:15:02 -0400 (EDT) To: Florian Weimer cc: pgsql-interfaces@postgresql.org Subject: Re: Type OIDs In-reply-to: <87r5xxwt3s.fsf@mid.deneb.enyo.de> References: <877hztupfn.fsf@mid.deneb.enyo.de> <10172.1244057188@sss.pgh.pa.us> <87r5xxwt3s.fsf@mid.deneb.enyo.de> Comments: In-reply-to Florian Weimer message dated "Sat, 06 Jun 2009 12:32:07 +0200" Date: Sat, 06 Jun 2009 11:15:02 -0400 Message-ID: <9704.1244301302@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/5 X-Sequence-Number: 6873 Florian Weimer writes: > By the way, the binary encoding would be pretty useful for BYTEA > columns and parameters, but it's a pretty hefty burden for almost > anything else. Wouldn't it make sense to add a format flag which > basically says "binary if it's BYTEA, otherwise text"? What is "easy" is very much in the eye of the beholder --- I would think for instance that a lot of people would consider integer columns to be easy enough to deal with in binary format. ntohl() isn't much of a burden. As far as output goes, I seem to recall some discussion awhile back of a format value that would mean "send in binary" where the specific list could be set by the client. This would seem to me to be a lot more useful and less klugy than hard-wiring bytea as a special case. On the input side it's much more questionable since (as you noted) clients don't always have a solid grasp on which parameters are which types. regards, tom lane