X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D71D7D1B1EC for ; Wed, 9 Jun 2004 03:36:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09210-09 for ; Wed, 9 Jun 2004 06:36:30 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 36FF8D1B192 for ; Wed, 9 Jun 2004 03:36:27 -0300 (ADT) Received: (qmail 26250 invoked by uid 65534); 9 Jun 2004 06:36:26 -0000 Received: from dsl-213-023-254-008.arcor-ip.net (EHLO colt.pezone.net) (213.23.254.8) by mail.gmx.net (mp021) with SMTP; 09 Jun 2004 08:36:26 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Tom Lane , Kyle Subject: Re: Getting FK relationships from information_schema Date: Wed, 9 Jun 2004 08:36:25 +0200 User-Agent: KMail/1.5.1 Cc: pgsql-sql@postgresql.org References: <40C500D8.9060009@actarg.com> <40C5D790.6090407@actarg.com> <16089.1086757487@sss.pgh.pa.us> In-Reply-To: <16089.1086757487@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200406090836.25473.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/66 X-Sequence-Number: 18011 Tom Lane wrote: > Kyle writes: > > I think this is only an issue when the user relies on postgres to > > choose a constraint name automatically. Seems like a reasonable > > approach would be to have postgres choose a name for the constraint > > that happens to be unique in the schema (like tablename_fkey_$1). > > We have discussed changing the default names of FK constraints > before. I have no problem with doing something like the above --- any > objection out there? I think it's a good idea. It will also make the error messages of the kind "foreign key $1 violated" a bit clearer by default. There will, however, be complaints that the constraint names are not automatically renamed with the table; but we are used to those by now.