Re: Foreign key UI bug - Mailing list pgadmin-support

From Guillaume Lelarge
Subject Re: Foreign key UI bug
Date
Msg-id 4CE7E4A7.1050804@lelarge.info
Whole thread Raw
In response to Re: Foreign key UI bug  (Michael Shapiro <mshapiro51@gmail.com>)
Responses Re: Foreign key UI bug
List pgadmin-support
Le 20/11/2010 15:15, Michael Shapiro a écrit :
> Theoretically, you could have the same problem with the primary key -- there
> could be an index with that name already.

If it happens, it would be PostgreSQL fault, not pgAdmin. The name of
the constraint and the name of the index, in a primary key and in a
unique contraint, are determined by PostgreSQL, not pgAdmin. On the
contrario, the name of the index of a foreign key is determined by
pgAdmin because this is not a PostgreSQL feature.

> But in practice it doesn't happen. You could generate a name for the foreign
> key based on similar pattern for the pk
> and if it fails, then it falls on the user to provide a name. Seem like it
> would work 99% of the time.
> 

I guess Magnus's idea is the good one (fk_tablename_columnname).


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


pgadmin-support by date:

Previous
From: Michael Shapiro
Date:
Subject: Re: Foreign key UI bug
Next
From: Guillaume Lelarge
Date:
Subject: Re: Foreign key UI bug