Re: Multiple foreign keys with the same name and information_schema

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

>
> 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 ;-)

Yes, my bad. Anyway, it doesn't help, I have both tables on the same schema.

>
> 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
>

Yes, I know that following the SQL standards is the way to go, but
sometimes this has to be done in databases I don't design, so I have
to be prepared for every case. I think I'll use the pg_catalog for
this case.

Thank you for you answer,

Jonathan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rodrick Hales 2009-08-10 16:31:34 NOTICE: there is no transaction in progress
Previous Message Tom Lane 2009-08-10 15:07:54 Re: Multiple foreign keys with the same name and information_schema