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