Re: Convert from hex to string - Mailing list pgsql-general

From Jim Nasby
Subject Re: Convert from hex to string
Date
Msg-id 5664D704.7010201@BlueTreble.com
Whole thread Raw
In response to Re: Convert from hex to string  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-general
On 11/26/15 1:12 AM, Francisco Olarte wrote:
> Anyway, I think people should be told to respect types, and people
> should be teach that strings are sequences of characters, that to do
> what people think is 'hex encoding' ( two digits per*byte*, no
> delimiter ), you need to first transform the string to bytes, then
> hex-encode that.

BTW, it wouldn't be that difficult to create a hex data type that worked
like bytea but accepted only hex strings. Likewise for a base64 type.
Only downside is you'd probably have to do it in C, because no other
language can handle cstring and I don't think there's any built-in
conversion functions with the correct parameters.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: Jim Nasby
Date:
Subject: Re: plperlu stored procedure seems to freeze for a minute
Next
From: Jim Nasby
Date:
Subject: Re: FATAL: unable to read data from DB node 0