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 1php2X-0006sQ-LH for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Mar 2023 09:57:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1php2W-0004q0-A3 for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Mar 2023 09:57:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1php2V-0004pr-9B for pgsql-bugs@lists.postgresql.org; Thu, 30 Mar 2023 09:57:52 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1php2S-00017k-98 for pgsql-bugs@lists.postgresql.org; Thu, 30 Mar 2023 09:57:50 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id ECFDE3200754; Thu, 30 Mar 2023 05:57:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 30 Mar 2023 05:57:45 -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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680170264; x= 1680256664; bh=7P6PTykbitGVzLoTBUovWiVFmQb2PkgXx/hZSEI3IXI=; b=k eAYDsKfGvpREFLHx+8p0jEAMYBpBe9X/Dttm6DP8u1fkARcM8ftcM0bPCBZb3IU8 e16P7CCP1Eb9uuEdSmwaO1402qmfXty8Tgk0hObVwfS0fBC8UU8zwnO6x720v06y YZBZkTAwKjccRX5qX4dt437qvnIELkW+Di/P4GsJm+zBd750P7Gu5DpwFcWiqwt4 vhXrAkUn7LYZW94LCgXQQxPLaMVy2IRYvvSWKj8E0wmRs60cNNyKt/yO6rs2lO9c wFg6CO8OzXFC7LR+JcsHxD5rVf8fR7cszDKZYL88EDMBqsJSYux2GiFLOEJHfOvx hJq3MoxSc3vz5DHHLgS3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehkedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduff dtffffheffhfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhep vghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr gh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Mar 2023 05:57:43 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 02081DB6; Thu, 30 Mar 2023 11:57:40 +0200 (CEST) Date: Thu, 30 Mar 2023 11:57:40 +0200 From: Alvaro Herrera To: Tom Lane Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access Message-ID: <20230330095740.irhck6e5zbt3jqer@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3994000.1680106346@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Mar-29, Tom Lane wrote: > PG Bug reporting form writes: > > The following query: > > CREATE TABLE pt(tid oid, id int, PRIMARY KEY(tid, id)); > > CREATE TABLE ft(id int, FOREIGN KEY (tableoid, id) REFERENCES pt); > > produces a valgrind-detected error: > > We should probably just disallow system columns as foreign keys. > There was a legitimate use-case for that with OID columns, but > no more. +1 -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/