Re: Getting FK relationships from information_schema - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Getting FK relationships from information_schema
Date
Msg-id 200406090836.25473.peter_e@gmx.net
Whole thread Raw
In response to Re: Getting FK relationships from information_schema  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Getting FK relationships from information_schema  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:
> Kyle <kyle@actarg.com> 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.



pgsql-sql by date:

Previous
From: mixo
Date:
Subject: Last insert id
Next
From:
Date:
Subject: Re: Last insert id