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 1kNOFj-0003QG-1o for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2020 22:37:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kNOFg-00039I-Ue for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Sep 2020 22:37:40 +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 1kNOFg-00039B-Oj for pgsql-bugs@lists.postgresql.org; Tue, 29 Sep 2020 22:37:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNOFe-00076K-Cp for pgsql-bugs@postgresql.org; Tue, 29 Sep 2020 22:37:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08TMbZlI725026; Tue, 29 Sep 2020 18:37:35 -0400 From: Tom Lane To: David Rowley cc: Alvaro Herrera , Nagaraj Raj , Pg Bugs Subject: Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition In-reply-to: References: <64062533.78364.1601415362244.ref@mail.yahoo.com> <64062533.78364.1601415362244@mail.yahoo.com> <724329.1601418149@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Wed, 30 Sep 2020 11:29:37 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <725024.1601419055.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Sep 2020 18:37:35 -0400 Message-ID: <725025.1601419055@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On Wed, 30 Sep 2020 at 11:22, Tom Lane wrote: >> Indeed. However, this complaint shows that the error message is not cl= ear >> enough. I propose changing it to >> ERROR: unique constraint on partitioned table must be a superset of the= partitioning columns >> or perhaps >> ERROR: unique constraint on partitioned table must include all partitio= ning columns > I prefer the former. Although I'd rather see the constraint type > mentioned explicitly rather than using the word "unique" regardless of > what the constraint type is. If the DETAIL has that, which it does, I'd rather have the primary text lay out the general rule not a specific case. Anybody who is not clear that a pkey is a kind of unique constraint will get that from reading the DETAIL. Also, avoiding that insertion should allow more robust translation of the primary message, which is something we should worry about if we are concerned that users won't understand the message. FWIW, after a few minutes' more thought I think I like the second wording; it's just as precise and does not rely on two-dollar words. I'm not dead set on it though. regards, tom lane