Re: RFD: hexstring(n) data type - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: RFD: hexstring(n) data type
Date
Msg-id 87k5iwavf1.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: RFD: hexstring(n) data type  (Bruce Momjian <bruce@momjian.us>)
Responses Re: RFD: hexstring(n) data type
List pgsql-hackers
I don't think we should define types based on how they print. We should define
types based on what they contain. bytea is a perfectly good datatype for
storing binary data, though perhaps we could use a bytea(n) for fixed size
binary data.

However bytea has an inconvenient string representation. Really I would prefer
if bytea were *always* read and written in hex format. We could have a guc to
enable this but it would make it hard to write code which would function
consistently as part of a larger application.

I think this is more akin to the MONEY data type. Really it would be better if
we could declare columns as NUMERIC but attach a "default format" to them for
use when string representation is desired. Similarly with bytea we could
choose a default string representation different from the default in/out
functions.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Lessons from commit fest
Next
From: Tom Lane
Date:
Subject: Re: DROP DATABASE vs patch to not remove files right away