Re: RFD: hexstring(n) data type

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: RFD: hexstring(n) data type
Дата
Msg-id 87k5iwavf1.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: RFD: hexstring(n) data type  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: RFD: hexstring(n) data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Lessons from commit fest
Следующее
От: Tom Lane
Дата:
Сообщение: Re: DROP DATABASE vs patch to not remove files right away