pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: Transform groups
Date: Tue, 29 Apr 2003 15:34:36 -0400
Message-ID: <4980.1051644876@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0304291736590.2161-100000@peter.localdomain>
References: <Pine.LNX.4.44.0304291736590.2161-100000@peter.localdomain>

Peter Eisentraut <peter_e@gmx.net> writes:
> The SQL standard defines a concept called "transform groups", which are
> basically pairs of input/ouput functions that can be switched between.

> Is this something worth investigating?

Perhaps, but there is little time left to get it done for 7.4.  Can we
lay out a strategy that will let us add such things incrementally,
without another protocol break later?

What I had personally been planning to do was restore the typsend and
typreceive columns of pg_type, defined on the order of

	typsend(mytype) returns bytea
	typreceive(bytea) returns mytype

and then define some simple conventions, probably network-byte-order
based, that these functions would be expected to adhere to for the
external binary representation.  The on-the-wire representation is
a network-byte-order length followed by whatever contents the
send routines put into their bytea results.

I don't think this would scale very well to multiple external
representations, though; sure you could define a switch somewhere, but
what are the odds that N different send/receive functions would all pay
attention to it?  And how would you know if they didn't?

The implementations of these functions would probably mostly depend on a
small set of conversion routines similar to the existing pq_getint and
pq_putint routines, so it might be possible to do simple things like
switching endianness in a centralized way.  But I'm not sure what
happens if you want bigger changes than that.

			regards, tom lane




view thread (2+ messages)

Message-ID: <4980.1051644876@sss.pgh.pa.us>
Permalink:  ../4980.1051644876@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4980.1051644876@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, pgsql-hackers@postgresql.org
  Subject: Re: Transform groups
  In-Reply-To: <4980.1051644876@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox