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 1sgec7-005gMq-D0 for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Aug 2024 06:14:35 +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 1sgec4-0074gu-D1 for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Aug 2024 06:14:32 +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 1sgec2-0074gm-Sd for pgsql-bugs@lists.postgresql.org; Wed, 21 Aug 2024 06:14:32 +0000 Received: from fout7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgec0-000gRC-0y for pgsql-bugs@postgresql.org; Wed, 21 Aug 2024 06:14:29 +0000 Received: from phl-compute-02.internal (phl-compute-02.nyi.internal [10.202.2.42]) by mailfout.nyi.internal (Postfix) with ESMTP id 5A871138FE70; Wed, 21 Aug 2024 02:14:26 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 21 Aug 2024 02:14:26 -0400 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=fm3; t=1724220866; x=1724307266; bh=Clu/b1tDM0L+Iafo0466ZIAIQGKAVmxa eHLzI83RMUk=; b=fCmK7etM2YVLdNy3cNC9ZyXOnFGJ3zQbw/KFr8vKU3Tmrl59 9E+KnUyAyHEr8maR3s+nMhdWBO98onKUEHdNecE1T2cTrvezNq8V9ghcypm4fZQ/ GdpDVXHR9b5wzJ/yXpURlhgL8jtSk1uELeLHJMTgzQizDsBi2DpGPdr0AoV0Is1U b72uSRkhSEcjkLn1AoUhDdGESKl5bAeyiyVl4E34s66t/TKJcZGSq3WJm5jZMzUj tBzKEBzf60D4dQqIEQMk4zq6hqoi+qe7+cVhNY73P8hBPAKXlT9B8wr0TO5Bsj/z Tv9SiOY6izjFodBJgA/0u6qTXawHr9cd/mNFsg== 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=fm1; t=1724220866; x= 1724307266; bh=Clu/b1tDM0L+Iafo0466ZIAIQGKAVmxaeHLzI83RMUk=; b=E W49ou7qaLDdmCOC8fnYiOTbnq+zt0sxAAjZ3cIqCMiAMgigtdYv7JwSNt+WYZTzC frUG52ECm3s0e9KNwVNuwW4F2KmDxkgs9NNLUbM8Utgzy2VOrorKVJnBjG0rrx93 ijp7BOnnKmxjzl5oBfnzcHjR1qGB6lGQ4bVocQygXhGL6KdR5Gt8rrd4WEaYD6Uw 4IBNICZX/LzLC5cZpZ7eTe1QaawLr7baVekb8c1uRuBOIh6cS6mTMvGzw4rdy5gr pJrjCht8TLdLESgyKtHbfvVirc0Dm7AGRPMTh3TuQ+ykgqfMrCYpzxA2OFJ0CY8+ pLxzWPUu5EmIeK2QSU0nQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddujedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefrvghtvghrucfgihhsvghn thhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgheqnecuggftrfgrth htvghrnhepgfejtdfhkeeftdeugfeileehteeljeeghfeuledthfeutedvffdukeefjefh geehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepph gvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhspd hrtghpthhtohepphhgshhqlhdqsghughhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Aug 2024 02:14:25 -0400 (EDT) Message-ID: <2e7acd5f-5d34-4802-a5e2-fa36433d133c@eisentraut.org> Date: Wed, 21 Aug 2024 08:14:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: CREATE CAST allows creation of binary-coercible cast to range over domain To: Tom Lane Cc: pgsql-bugs References: <076968e1-0852-40a9-bc0b-117cd3f0e43c@eisentraut.org> <1537781.1724165175@sss.pgh.pa.us> <1611527.1724175039@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <1611527.1724175039@sss.pgh.pa.us> 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 20.08.24 19:30, Tom Lane wrote: > I wrote: >> I think it's an oversight that we allow binary-coercible casts >> involving range types at all. There are no other nesting cases to >> worry about, because CreateCast already rejects binary-coercible casts >> applied to composites and arrays, explaining >> * We know that composite, enum and array types are never binary- >> * compatible with each other. They all have OIDs embedded in them. >> But range types also embed their own OID, so I don't see why that >> concern doesn't apply to them. > > In short, more or less as attached. (I didn't bother with a > regression test, since none of the adjacent error checks are > covered either.) This patch looks right. > I'm unsure whether to back-patch this. If somebody were using > such a cast today, it might seem to mostly work, as long as the > two kinds of ranges had the same behavior. So they might not > appreciate us breaking it in a minor release. Maybe we should > put this into 17 but not further back. Yeah, 17 and up seems ok to me.