Re: [PATCH] Add function to_oct - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: [PATCH] Add function to_oct
Date
Msg-id CAEZATCWaQ+-7A9AxxUcxdhdOa4p54rSvKreHMXhnTJg6VuAURQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add function to_oct  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: [PATCH] Add function to_oct
List pgsql-hackers
On Thu, 17 Aug 2023 at 16:26, Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> Works for me.  I did it that way in v7.
>

I note that there are no tests for negative inputs.

Doing a quick test, shows that this changes the current behaviour,
because all inputs are now treated as 64-bit:

HEAD:

select to_hex((-1234)::int);
  to_hex
----------
 fffffb2e

With patch:

select to_hex((-1234)::int);
      to_hex
------------------
 fffffffffffffb2e

The way that negative inputs are handled really should be documented,
or at least it should include a couple of examples.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: persist logical slots to disk during shutdown checkpoint
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: WIP: new system catalog pg_wait_event