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 1tVWEM-009BFp-VG for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 13:36:19 +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 1tVWEM-0018Ur-7L for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 13:36:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVWEL-0018TQ-Qe for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 13:36:17 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVWEG-000XUv-0j for pgsql-hackers@postgresql.org; Wed, 08 Jan 2025 13:36:17 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id DCF0113801B0; Wed, 8 Jan 2025 08:36:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Wed, 08 Jan 2025 08:36:10 -0500 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=fm2; t=1736343370; x=1736429770; bh=q afKAqyxvyKTLs8dxMiGbfaWSxmlYu82FBNh/rcJDcU=; b=dYwlNQvM+rwMN1olR fs05nHzRI/pxu1zhqGuPp3IrQ7ltyDmEXG0KifQ9xoeVfcIZEIlIoUqe/9/tALcK B3VKL2XlgcArd6rWOpncBEreimSbf1FySeD+LuuhfNyd2vhh8UqKKXk7NywyHCjG yFQycmyAvmGkLoYQtUcgHA3+tufbjrFlkFxM9W7yXtkBsDqeex7hKid94oTwdZWN yp/sWWNWjJvsojy+DpI2sSH/U4Q8js5lzkjOKutNTdV32z1b96zGsyGaZt/2Zpno Igl0SG4SjclPQKBgVA22WQDxLds3bIfBRwici7tog84sylFwPvtWhNV1QacUAwDP fl/ag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepjefgjeevfeelleduueegveeh hfevgfetheevvdeiheehleekvedtleekgeeggeffnecuffhomhgrihhnpehgihhthhhusg drtghomhdpvghnthgvrhhprhhishgvuggsrdgtohhmpdhpohhsthhgrhdrvghsnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrh gvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesghhmrg hilhdrtghomhdprhgtphhtthhopeihrghsuhhordhhohhnuggrsehgmhgrihhlrdgtohhm pdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorh hg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jan 2025 08:36:10 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1736343368; bh=cduBiPHgPdR2PIXyTZ/hFESneezhcp05wEtsmliaVXg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=RYza5zo3256h0WOgCGISTXs9VvoJkJ7hOLeW57VkeUAHJmYlUbqxgyvDLKfDTcZtL RteQF0VHqmD93HN6fgT7Dv7y/2c0CN+smF3QLmPvIuI0PO5KyRZLwZC832FQw8uN/d /dLJClmw4+xl4FLF4s7bjBOxvF4VWOlbQlSDG0QQriy3t3vo9Mk/qYdASkiqr3K4H1 vOlTxNGE1BKcqb5GgjpYKC5tw2EWVd9K2e1lFPUkgUx5goVTuMUab9WTqmpeAa5M/0 pm8GzIASOoxXIpi8+oIF7RLCmnj6hnbHhmG43/RjC4tgLXLaWXEquUbtfpQGHSww2K hlrzvak0V8t3A== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id CCD07307; Wed, 8 Jan 2025 14:36:08 +0100 (CET) Date: Wed, 8 Jan 2025 14:36:08 +0100 From: Alvaro Herrera To: Yasuo Honda Cc: jian he , PostgreSQL-development Subject: Re: CREATE TABLE NOT VALID for check and foreign key Message-ID: <202501081336.5ntcq5oar24r@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 Hello, On 2025-Jan-07, Yasuo Honda wrote: > I'd like PostgreSQL to raise errors and/or warnings for the NOT VALID > check constraint for CREATE TABLE. > Ruby on Rails supports creating check constraints with the NOT VALID > option and I was not aware that it is just ignored until > https://github.com/rails/rails/issues/53732 issue is reported. Thanks. I left a comment there. I think raising a WARNING might work. > Rails has implemented a kind of workaround by not dumping the NOT > VALID option, but it does not help for the first execution. > https://github.com/rails/rails/pull/53735 Yeah, that's probably not ideal. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "You're _really_ hosed if the person doing the hiring doesn't understand relational systems: you end up with a whole raft of programmers, none of whom has had a Date with the clue stick." (Andrew Sullivan) https://postgr.es/m/20050809113420.GD2768@phlogiston.dyndns.org