Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qg4Z4-00ENRs-AZ for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2023 14:40:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qg4Z2-0099KU-UX for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2023 14:40:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qg4Z2-0099KG-KS for pgsql-hackers@lists.postgresql.org; Tue, 12 Sep 2023 14:40:28 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qg4Yz-004AB4-Jg for pgsql-hackers@postgresql.org; Tue, 12 Sep 2023 14:40:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38CEeMTE2797314; Tue, 12 Sep 2023 10:40:22 -0400 From: Tom Lane To: Peter Eisentraut cc: =?UTF-8?Q?Dagfinn_Ilmari_Manns=c3=a5ker?= , pgsql-hackers@postgresql.org Subject: Re: Adding a pg_get_owned_sequence function? In-reply-to: <4970adf1-cdb0-9ae5-d405-e9c3395d9931@eisentraut.org> References: <87jzwcsasv.fsf@wibble.ilmari.org> <4970adf1-cdb0-9ae5-d405-e9c3395d9931@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Tue, 12 Sep 2023 09:33:54 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2797312.1694529622.1@sss.pgh.pa.us> Date: Tue, 12 Sep 2023 10:40:22 -0400 Message-ID: <2797313.1694529622@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > Would it work to just overload pg_get_serial_sequence with regclass > argument types? Probably not; the parser would have no principled way to resolve pg_get_serial_sequence('foo', 'bar') as one or the other. I'm not sure offhand if it would throw error or just choose one, but if it just chooses one it'd likely be the text variant. It's possible that we could get away with just summarily changing the argument type from text to regclass. ISTR that we did exactly that with nextval() years ago, and didn't get too much push-back. But we couldn't do the same for the return type. Also, this approach does nothing for the concern about the name being misleading. regards, tom lane