pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access
Date: Wed, 29 Mar 2023 12:12:26 -0400
Message-ID: <3994000.1680106346@sss.pgh.pa.us> (raw)
In-Reply-To: <17877-4bcc658e33df6de1@postgresql.org>
References: <17877-4bcc658e33df6de1@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> 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.  I can't see a really good reason to use tableoid as a
foreign key, and none of the other system columns are stable
enough for this to be sane at all.  So it's hard to summon
interest in trying to remove bugs of this sort.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <3994000.1680106346@sss.pgh.pa.us>
Permalink:  ../3994000.1680106346@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3994000.1680106346@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, 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
  In-Reply-To: <3994000.1680106346@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox