bug in information_schema? - Mailing list pgsql-bugs

From Andrew - Supernews
Subject bug in information_schema?
Date
Msg-id slrncqh3h8.2kf6.andrew+nonews@trinity.supernews.net
Whole thread Raw
List pgsql-bugs
Found this in 7.4.5, verified it's still in 8.0b4:

test=> select * from information_schema.referential_constraints;
test|public|$1|test|public|reftest1_pkey|NONE|NO ACTION|CASCADE
test|public|$1|test|public|reftest1_pkey|NONE|NO ACTION|NO ACTION
test|public|$1|test|public|reftest1_pkey|NONE|NO ACTION|NO ACTION

In that case there are three tables all referencing the same column of a
fourth - but there is no way at all to tell which row corresponds to which
table, and hence no way to join against, say, table_constraints.

A similar issue may exist with the check_constraints view, which was the
only other place I found where constraint_name is used without any table
name being present. I don't know what the spec says, but it seems that
something is assuming that constraint_name is unique within the schema,
which of course is not the case in the above example.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

pgsql-bugs by date:

Previous
From: Neil Conway
Date:
Subject: plpgsql unreachable code (was BUG #1329: Bug in IF-ELSEIF-ELSE construct)
Next
From: Troels Arvin
Date:
Subject: Re: bug in information_schema?