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

From Michael Shapiro
Subject Re: Foreign key UI bug
Date
Msg-id AANLkTi=xXfUDpmyeMp+yZN_i8F87icmpjQsgPXY8skeT@mail.gmail.com
Whole thread
In response to Re: Foreign key UI bug  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: Foreign key UI bug
List pgadmin-support
Theoretically, you could have the same problem with the primary key -- there could be an index with that name already.
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. 

On Sat, Nov 20, 2010 at 7:49 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:

>>> Well, you could generate the name of the FOREIGN KEY in pgadmin as
>>> well, then you know what it'll be... Even when the user doesn't specify one.
>>>
>>> Another one would be to name the index fki_<tablename>_<columnname> or
>>> something like that instead.
>>>
>>
>> I thought about it, but rejected it on the idea that you can't be sure
>> the index creation will work (the same index name can already exist).
>> But, thinking more about it, the old algorithm wasn't better at it anyway.
>

pgadmin-support by date:

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