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 1pKKQq-0008Lg-IP for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 14:37:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKKQo-0000Yj-7U for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 14:37:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKKQn-0000Ya-TF for pgsql-hackers@lists.postgresql.org; Tue, 24 Jan 2023 14:37:49 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pKKQl-0006JG-Uw for pgsql-hackers@postgresql.org; Tue, 24 Jan 2023 14:37:49 +0000 Received: by mail-wm1-x329.google.com with SMTP id e19-20020a05600c439300b003db1cac0c1fso11481889wmn.5 for ; Tue, 24 Jan 2023 06:37:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2cKg+j4mVn0weJShEyspRZMGNqSARC7D2FFm/jU+3HY=; b=ChR9JCubhlLsmSwGDUetWa4C4Avkjdhhd8SkVrVsaD14EDqtQkkBQmML3tl99yzS0d S6FexfzBbH0LoCccvI/CnTPCBURcLlRQl4/SD29ws/0wTUzYFsXtYirBj2qBqpQ9eeWf gvktf7PUfBKA03Y7gFHe+xEMEchTNulIIOjHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2cKg+j4mVn0weJShEyspRZMGNqSARC7D2FFm/jU+3HY=; b=LtvI7wJ8vKWFhzJlaT9Cmu4o58B6/c1SlAJBcOcEK/qjUFdtZjEioG0Iu5jh5p+S73 TJftdKnjQszVxyMpvF5ioe1FJb2sHuyeeClAPqTG0ZqwUAV2S/v91kQWn1pb0Mu8fmRJ HRW+o8n8/W8aUA6biR5++5/q4avtKZz0YWEbZ/2qPOBS7pHLXg+VrzFQFd3hGo8asa+b XK8a9Xf/ZY0fqSt3CZ7oXicn4dt+tVXsn/gNHRDO5dY1DfzOMZqJ4k4G9Dm12B8JTUVY TPi5MyltriwjPlVAupuO9Ge40ygJepQk+SmlKMdcQV/jkX1QJ/HvLzgACvsUQtpo3czC z1GQ== X-Gm-Message-State: AO0yUKWbqzV93PjcJrpduRqsSEdP2D1Mq83oksG7Gzb9bRLJxeJMUvKC CWot19wkRDVEtdAuQs+uRBEuIX9eWdZ489Q0 X-Google-Smtp-Source: AK7set+0ak6ZAGP5ErmB2OVjm/5+XNQnHRp1hcBKceybtCI27JYmbZTaP9xSPNBLoheuy/BFiupFWQ== X-Received: by 2002:a05:600c:444a:b0:3dc:16d3:8c95 with SMTP id v10-20020a05600c444a00b003dc16d38c95mr1612735wmn.30.1674571065776; Tue, 24 Jan 2023 06:37:45 -0800 (PST) Received: from aivenlaptop.localnet ([45.13.105.93]) by smtp.gmail.com with ESMTPSA id t13-20020a1c770d000000b003db0ee277b2sm13607452wmi.5.2023.01.24.06.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 06:37:45 -0800 (PST) From: Ronan Dunklau To: Tom Lane , pgsql-hackers@lists.postgresql.org Cc: Pgsql Hackers , Paul Jungwirth Subject: Re: Exclusion constraints on partitioned tables Date: Tue, 24 Jan 2023 15:38:13 +0100 Message-ID: <10212835.nUPlyArG6x@aivenlaptop> In-Reply-To: <9ad3257d-db5b-e54e-f5e0-a54727b19327@illuminatedcomputing.com> References: <3585070.1671149527@sss.pgh.pa.us> <9ad3257d-db5b-e54e-f5e0-a54727b19327@illuminatedcomputing.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le vendredi 16 d=E9cembre 2022, 06:11:49 CET Paul Jungwirth a =E9crit : > On 12/15/22 16:12, Tom Lane wrote: > >> This patch also requires the matching constraint columns to use equali= ty > >> comparisons (`(foo WITH =3D)`), so it is really equivalent to the exis= ting > >> b-tree rule. > >=20 > > That's not quite good enough: you'd better enforce that it's the same > > equality operator (and same collation, if relevant) as is being used > > in the partition key. > > [snip] > > It might work better to consider the operator itself and ask if > > it's equality in the same btree opfamily that's used by the > > partition key. >=20 > Thank you for taking a look! Here is a comparison on just the operator > itself. >=20 I've taken a look at the patch, and I'm not sure why you keep the restricti= on=20 on the Gist operator being of the RTEqualStrategyNumber strategy. I don't=20 think we have any other place where we expect those strategy numbers to=20 match. For hash it's different, as the hash-equality is the only operator=20 strategy and as such there is no other way to look at it. Can't we just=20 enforce partition_operator =3D=3D exclusion_operator without adding the=20 RTEqualStrategyNumber for the opfamily into the mix ?