Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnOsI-0005uE-2H for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Aug 2018 13:51:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fnOsE-0002qx-8z for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Aug 2018 13:51:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnOsD-0002qq-Uj for pgsql-hackers@lists.postgresql.org; Wed, 08 Aug 2018 13:51:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fnOsB-0003yx-HL for pgsql-hackers@postgresql.org; Wed, 08 Aug 2018 13:51:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w78DpSkG012108; Wed, 8 Aug 2018 09:51:28 -0400 From: Tom Lane To: Bruce Momjian cc: KES , PostgreSQL-development Subject: Re: Typo in doc or wrong EXCLUDE implementation In-reply-to: <20180808130040.GA2611@momjian.us> References: <153121527691.1408.5686988620817799073@wrigleys.postgresql.org> <20180807173659.GD7297@momjian.us> <31616681533725753@sas1-d856b3d759c7.qloud-c.yandex.net> <20180808130040.GA2611@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 08 Aug 2018 09:00:40 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12106.1533736288.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 08 Aug 2018 09:51:28 -0400 Message-ID: <12107.1533736288@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > On Wed, Aug 8, 2018 at 01:55:53PM +0300, KES wrote: >> If such exclusion constraint would be marked as UNIQUE we can use it fo= r FK while implementing temporal/bi-temporal tables. > Yes, it would work, but doing that only for equality would be surprising > to many people because exclusion constraints are more general than > equality comparisons. In general, we should be discouraging people from using EXCLUDE syntax with simple equality operators, not encouraging them to do so. It's less efficient and less portable than a regular btree-based uniqueness constraint. So I think this proposal is a bad idea regardless of whether it'd be technically feasible or not. regards, tom lane