Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiVFo-000708-Kp for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Jul 2019 02:44:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hiVFn-0000jc-GD for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Jul 2019 02:44:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiVFn-0000gQ-7H for pgsql-bugs@lists.postgresql.org; Wed, 03 Jul 2019 02:44:15 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiVFl-0008Cp-20 for pgsql-bugs@lists.postgresql.org; Wed, 03 Jul 2019 02:44:14 +0000 Received: from [192.168.127.1] (port=18455 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1hiVFh-000F1b-KR; Wed, 03 Jul 2019 02:44:09 +0000 Received: from [127.0.0.1] (port=58486 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1hiVFg-000641-Ve; Wed, 03 Jul 2019 02:44:09 +0000 From: Andrew Gierth To: Tom Lane Cc: Manuel Rigger , PostgreSQL mailing lists Subject: Re: SELECT results in "ERROR: index key does not match expected index column" In-Reply-To: <17559.1562107820@sss.pgh.pa.us> (Tom Lane's message of "Tue, 02 Jul 2019 18:50:20 -0400") Message-ID: <87tvc3q1ob.fsf@news-spur.riddles.org.uk> References: <17559.1562107820@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Wed, 03 Jul 2019 03:44:08 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Tom" == Tom Lane writes: Tom> (You realize of course that an index on a constant is pretty Tom> useless. I wonder if we should disallow that.) Unique index on a constant is a standard technique for forcing a table to be limited to at most one row (or with a partial index, at most one row matching a condition). Non-unique index on a constant is probably not useful though. -- Andrew (irc:RhodiumToad)