Re: Foreign key UI bug

From: Michael Shapiro <mshapiro51(at)gmail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Aren Cambre <aren(at)arencambre(dot)com>, pgadmin-support(at)postgresql(dot)org
Subject: Re: Foreign key UI bug
Date: 2010-11-20 14:15:13
Message-ID: AANLkTi=xXfUDpmyeMp+yZN_i8F87icmpjQsgPXY8skeT@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(at)lelarge(dot)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.
> >
>

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2010-11-20 15:09:27 Re: Foreign key UI bug
Previous Message Guillaume Lelarge 2010-11-20 13:49:19 Re: Foreign key UI bug