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 1rNFAI-00AMzA-Ir for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 16:41:23 +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 1rNFAH-00EHgt-Mb for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 16:41:21 +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 1rNFAH-00EHgl-DG for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 16:41:21 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNFAE-000gOZ-U0 for pgsql-hackers@postgresql.org; Tue, 09 Jan 2024 16:41:20 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 6065D320034E; Tue, 9 Jan 2024 11:41:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 09 Jan 2024 11:41:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1704818476; x=1704904876; bh=1R52myXiCyir3UMk1wwpnG+vJjzhy6zt melywTv4QF0=; b=G3LoK3LfyiWaviSLpfNy8qIGfsOOr2nXJOIz7+sII18mV3gt 4q/yfgvJbIHdZotNBt9rCk9schoe6+KctnHKrNgtZSIhx6Br3JNj0BQux9sCtLvp 5IH33oILfpMX7c7LkpZCQa3dhR1Ajh+Hm4tUfG6VFVAW9HXRbj0ZYwdRGQhB8IdR vgaqLwlK8AUvTpKRsYBv3uOyV80yhM/UkOdsJvuNuIROxuzN8Hs5cJkxV9ho8yQ6 qSCaX0r0OwZd+UKBWD3NoZ1SeuERRj1lcqKAg1GZKlgjnFJsonpgM+nKAvLglCUp Nt8k8+cgkS0SaiYE4k8LiLaHyNv9MtAvX8SuWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704818476; x= 1704904876; bh=1R52myXiCyir3UMk1wwpnG+vJjzhy6ztmelywTv4QF0=; b=n 5eb8PMIO6vWDLxUPZ0NwssmtfOwaB9roSCM/aT4dBUnFoUpsSwQceHb9wqe7tub3 /uCIqJgCOIVmO5u6/pStAhwkHZBBppEXX3KOF6seMcPfBZCXhP3yjLPDIF7xz4AW EFz589qI5suRv0Gvc9rJMiiqbmZGVgSkkZ7riuf51xH2zaQ1V+kaisjSz2KURxxk 12qHvPLY/Wh0uFlv06NymcIUj2t+IyOgNxuvFdTQgAQRsBMy1IxeIsy3Lb/NfSSV usmLllyike8GT8Cq8FCyoJyBUhvbm3j4UEfL7d52a9EbjbPwBBgrjNJvJHkKrpkO 93Z3GSlVW/s+aApJUMSJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehledgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh eqnecuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfeileehteeljeeghfeuledthfeu tedvffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Jan 2024 11:41:15 -0500 (EST) Message-ID: Date: Tue, 9 Jan 2024 17:41:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Adding a pg_get_owned_sequence function? Content-Language: en-US To: Nathan Bossart , =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= Cc: vignesh C , Tom Lane , pgsql-hackers@postgresql.org 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> From: Peter Eisentraut In-Reply-To: <20240108210847.GA2796792@nathanxps13> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 08.01.24 22:08, Nathan Bossart wrote: > I think these are reasonable concerns, but with this patch, we now have the > following functions: > > pg_get_identity_sequence(table regclass, column name) -> regclass > pg_get_serial_sequence(table text, column text) -> text > > If we only look at the names, it sure sounds like the first one only works > for identity columns, and the second only works for serial columns. But > both work for identity_and_ serial. The real differences between the two > are the parameter and return types. Granted, this is described in the > documentation updates, but IMHO this is a kind-of bizarre state to end up > in. Yeah, that's really weird. 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?