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 1jN2xt-0006Yp-Kt for pgsql-committers@arkaria.postgresql.org; Fri, 10 Apr 2020 23:21:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jN2xs-0008SX-GM for pgsql-committers@arkaria.postgresql.org; Fri, 10 Apr 2020 23:21:36 +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 1jN2xs-0008SQ-Ao for pgsql-committers@lists.postgresql.org; Fri, 10 Apr 2020 23:21:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jN2xn-0006b7-Na for pgsql-committers@lists.postgresql.org; Fri, 10 Apr 2020 23:21:33 +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 03ANLT2t013032; Fri, 10 Apr 2020 19:21:29 -0400 From: Tom Lane To: Bruce Momjian cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: doc: add examples of creative use of unique expression indexes In-reply-to: <20200410214821.GC24988@momjian.us> References: <2304.1586532634@sss.pgh.pa.us> <20200410214821.GC24988@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 10 Apr 2020 17:48:21 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13030.1586560889.1@sss.pgh.pa.us> Date: Fri, 10 Apr 2020 19:21:29 -0400 Message-ID: <13031.1586560889@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > I agree with your analysis. I still want to have some mention that > partial indexes can be used to create single-NULL columns, which might > be required for compatibility with other databases. Attached is an > updated patch which removes the previous commit but adds a mention of > this. The single-null thing is probably a useful example, but please make it an actual separate example, or at least its own para outside the existing sections. Also, the existing example demonstrating that seems overcomplicated; why not just create unique index ... (1) where (foo is null); regards, tom lane