Re: to_hex() for negative inputs - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: to_hex() for negative inputs
Date
Msg-id ac4df0fb-5b57-4c18-30c1-c24d42e562b6@enterprisedb.com
Whole thread Raw
In response to to_hex() for negative inputs  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: to_hex() for negative inputs
List pgsql-hackers
On 24.01.23 14:10, Dean Rasheed wrote:
> I also think it might be useful for it to gain a couple of boolean options:
> 
> 1). An option to output a signed value (defaulting to false, to
> preserve the current two's complement output).

I find the existing behavior so strange, I would rather give up and 
invent a whole new function family with correct behavior, which could 
then also support octal and binary, and perhaps any base.  This could be 
something generally named, like "convert" or "format".

> 2). An option to output the base prefix "0x" (which comes after the
> sign, making it inconvenient for the user to add themselves).

This could also be handled with a "format"-like function.




pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: pgsql: Rename contrib module basic_archive to basic_wal_module
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Rename contrib module basic_archive to basic_wal_module