Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7o7e-0005WB-4C for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2022 01:42:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p7o7c-0002VK-Tw for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2022 01:42:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7o7c-0002TY-KP for pgsql-hackers@lists.postgresql.org; Wed, 21 Dec 2022 01:42:16 +0000 Received: from vm3.eradman.com ([45.63.64.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p7o7X-0001Vj-Cp for pgsql-hackers@postgresql.org; Wed, 21 Dec 2022 01:42:15 +0000 Received: from vm3.eradman.com (localhost [127.0.0.1]) by vm3.eradman.com (OpenSMTPD) with ESMTP id 3663a0da; Tue, 20 Dec 2022 20:42:10 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=eradman.com; h=date:from :to:cc:subject:message-id:references:mime-version:content-type :content-transfer-encoding:in-reply-to; s=selector1; bh=UBAhB0qP 5D5uY1Q7WmlmggqMqhU=; b=0zxmJQ+0szo98I2FHv7BOSc/0VDKaF/EDWe4VIZR GcomMPW8vNsq/ivrBXww2v+5OJjDhhpF13CjnKuqZWK9+rxt/Oh//jsAhcLlQaqW gx2+xfVMnVJTKbHKNHEqPF44g77b3p4wZdlQGb7d6zDjwl1wJGi2h8ZuPUK7hTZj 0zc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=eradman.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :content-transfer-encoding:in-reply-to; q=dns; s=selector1; b=a5 1BskQTzpw1GnCwZ7Vl+T/vzqAnvIF8Xx8nRHFkAXnhYB0DWi52spOW7sbezzS7P8 ods0aNp1F3GQHa9MsL5eQCl4IjD9kY3KTdqBEBoTNPocvwROl8LcueCb6jtT4WhS Ac/qXG8y/i8fSdqX1ZJvd9syyFOLUnCzV2rauL6hg= Received: from localhost (vm3.eradman.com [local]) by vm3.eradman.com (OpenSMTPD) with ESMTPA id 26127a06; Tue, 20 Dec 2022 20:42:10 -0500 (EST) Date: Tue, 20 Dec 2022 20:42:10 -0500 From: Eric Radman To: Ian Lawrence Barwick Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH] Add function to_oct Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 21, 2022 at 08:36:40AM +0900, Ian Lawrence Barwick wrote: > 2022年12月21日(水) 7:08 Eric Radman :> > > 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.