Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tu8ZD-003zba-Ib for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Mar 2025 11:23:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tu8ZC-00B8N3-91 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Mar 2025 11:23:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tu8ZB-00B8MT-Dx for pgsql-hackers@lists.postgresql.org; Mon, 17 Mar 2025 11:23:33 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tu8Z9-003JS2-0j for pgsql-hackers@postgresql.org; Mon, 17 Mar 2025 11:23:32 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 667A925401A9; Mon, 17 Mar 2025 07:23:29 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 17 Mar 2025 07:23:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1742210609; x=1742297009; bh=P IS4LDWgVDpBaRbWv0JEgel+dRFcBDz6C1LcWzacG7o=; b=QvmNt+IGwbG7tiX44 PjtHEQlAoUcF9EX2UGZFjwncnn/xESJTcOmANZxl+SmtCbXt0MzirSrwWT0nEg0I wdOaXOZLT4jVZWiSnAcxBsGSQA42dOc62oYM+7FZKr4oZCGtBW9OLLHmoYJ2cFfM 6VBdvQbQeBPkMIwWCFv5c0VmeG2CXlLrlQAkTrrtmAwSg1TBoGA29Rc7iDCnGeX8 LP0xOOF0NyvqMdr+oT6ujOi0DBHnlNDidUDyQ1zML0QaZoKKeXujRtfMsCTHN6/x i3pttsbqfcKxkPSyHyQ53VxVeqaLwV0QWF/PA3GNvlCHz47R8o7j+pVbKaA8VA+/ YdhKQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddufeelfeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesmhekreertddt jeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepleefhefgieetffffudef uedvfeegffeujedtheevudehjefgheehvedugffgfeeinecuffhomhgrihhnpehpohhsth hgrhdrvghspdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnoh dqihhprdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopegrshhhuhhtohhshhdrsggrphgrthdrohhsshesghhmrghilhdrtghomhdprh gtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhr tghpthhtoheprhhushhhrggshhdrlhgrthhhihgrsehgmhgrihhlrdgtohhmpdhrtghpth htohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Mar 2025 07:23:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1742210605; bh=/5eWPLmk+3IHbaH3OZ9U9b6SqQhanbkZiH9vdOruV8Y=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=oEFdLhqUatoyDjAmYZQhaT0J2qGh9p4h1h3YMpbXXzVw+r6xsDSd5NCJhtavQXVeQ ZwQ5NX1uX2sL/qKv5eKEIvgKxuzWjQgiAcQjKI+MBUmhB9dwQzC8SA5pdduTMuZ+6A YU7MQv3f6C2nmv7TGHZwWmkqBqq96WO5w28Ikp5/UQqCHclcQoDv4p4+P+1CyDoVft EYUNC6GjqN4+/ZX59NqLbYhN9vez1Z+IZQewsuaelwZwyIdfGQPJkXl/j3cqbs9RoN IwBPGaEvvZSsYb+M2nJweGBKnGwdmv3X3HzhR+zjPGAxagjYG5Ql7zAvKSQs34UeIM xmQpwHTfDY9rg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id D25C787; Mon, 17 Mar 2025 12:23:25 +0100 (CET) Date: Mon, 17 Mar 2025 12:23:25 +0100 From: Alvaro Herrera To: jian he Cc: Rushabh Lathia , Ashutosh Bapat , PostgreSQL Hackers Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints Message-ID: <202503171123.5w5g4dg3idca@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ldvlykszwxg6fnhc" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ldvlykszwxg6fnhc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2025-Mar-17, jian he wrote: > hi. > I played around with it. > > current syntax, we don't need to deal with column constraint grammar. > like the following can fail directly: > create table t0(a int constraint nn not null a not valid); > we only support table constraint cases like: > alter table lp add constraint nc1 not null a not valid; > > since CREATE TABLE with invalid constraint does not make sense, so > we can just issue a warning. like: > create table t0(a int, constraint nn not null a not valid); > WARNING: CREATE TABLE NOT NULL NOT VALID CONSTRAINT WILL SET TO VALID > the wording needs to change... Yeah, we discussed this elsewhere. I have an alpha-quality patch for that, but I wasn't too sure about it ... [1] https://postgr.es/m/CACJufxEQcHNhN6M18JY1mQcgQq9Gn9ofMeop47SdFDE5B8wbug@mail.gmail.com -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ --ldvlykszwxg6fnhc Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Throw-warning-if-NOT-VALID-is-given-during-CREATE-TA.patch"