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 1rNFVS-00APcx-9F for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 17:03:14 +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 1rNFVR-00EVYG-0k for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 17:03:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNFVQ-00EVY7-NR for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 17:03:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNFVO-000gLU-EM for pgsql-hackers@postgresql.org; Tue, 09 Jan 2024 17:03:12 +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 409H366e2196400; Tue, 9 Jan 2024 12:03:06 -0500 From: Tom Lane To: Peter Eisentraut cc: Nathan Bossart , =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , vignesh C , pgsql-hackers@postgresql.org Subject: Re: Adding a pg_get_owned_sequence function? In-reply-to: References: <87jzwcsasv.fsf@wibble.ilmari.org> <4970adf1-cdb0-9ae5-d405-e9c3395d9931@eisentraut.org> <2797313.1694529622@sss.pgh.pa.us> <87v8cfo32v.fsf@wibble.ilmari.org> <20231024162929.GA871220@nathanxps13> <87a5pfn4o5.fsf@wibble.ilmari.org> <20240108210847.GA2796792@nathanxps13> Comments: In-reply-to Peter Eisentraut message dated "Tue, 09 Jan 2024 17:41:14 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2196398.1704819786.1@sss.pgh.pa.us> Date: Tue, 09 Jan 2024 12:03:06 -0500 Message-ID: <2196399.1704819786@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 change the signature of pg_get_serial_sequence to > pg_get_serial_sequence(table anyelement, column text) -> anyelement > and then check inside the function code whether text or regclass was passed? Probably not very well, because then we'd get no automatic coercion of inputs that were not either type. Maybe it would work to have both pg_get_serial_sequence(table text, column text) -> text pg_get_serial_sequence(table regclass, column text) -> regclass but I wonder if that would create any situations where the parser couldn't choose between these candidates. regards, tom lane