Re: Multiple foreign keys with the same name and information_schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jonathan Tapicer <tapicer(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple foreign keys with the same name and information_schema
Date: 2009-08-10 15:07:54
Message-ID: 2240.1249916874@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jonathan Tapicer <tapicer(at)gmail(dot)com> writes:
> I was a able to do it using the pg_catalog tables, but I haven't found
> a way to do it using information_schema since it relies on foreign
> keys names being unique in the same catalog. Is this a known
> limitation?

Actually, the information_schema supposes that constraint names are
unique within a *schema*, not within a *catalog* (a/k/a database).
Don't know if that distinction can help you or not. You are correct
that Postgres is less rigid. We do not consider that to be a deficiency
on the Postgres side ;-)

If you want to use the information_schema to deal with this stuff, the
answer is to make sure that your application follows the SQL-standard
rule of not duplicating constraint names within a schema.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Tapicer 2009-08-10 15:25:22 Re: Multiple foreign keys with the same name and information_schema
Previous Message Jonathan Tapicer 2009-08-10 13:55:42 Multiple foreign keys with the same name and information_schema