Re: [PATCH] Add function to_oct

From: Eric Radman <ericshane(at)eradman(dot)com>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add function to_oct
Date: 2022-12-21 01:42:10
Message-ID: Y6JkciYiq4GqqEi4@vm3.eradman.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 21, 2022 at 08:36:40AM +0900, Ian Lawrence Barwick wrote:
> 2022年12月21日(水) 7:08 Eric Radman <ericshane(at)eradman(dot)com>:>
> > Hello!
> >
> > This patch is a new function based on the implementation of to_hex(int).
> >
> > Since support for octal integer literals was added, to_oct(int) allows
> > octal values to be easily stored and returned in query results.
> >
> > to_oct(0o755) = '755'
> >
> > This is probably most useful for storing file system permissions.
>
> Seems like it would be convenient to have. Any reason why there's
> no matching "to_oct(bigint)" version?

I couldn't think of a reason someone might want an octal
representation of a bigint. Certainly it would be easy to add
if there is value in supporting all of the same argument types.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-12-21 01:43:19 Re: Simplifications for error messages related to compression
Previous Message Michael Paquier 2022-12-21 01:13:58 Re: Use get_call_result_type() more widely