Re: Getting FK relationships from information_schema

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyle <kyle(at)actarg(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Getting FK relationships from information_schema
Date: 2004-06-09 06:36:25
Message-ID: 200406090836.25473.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
> Kyle <kyle(at)actarg(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message mkl 2004-06-09 06:54:17 Re: Last insert id
Previous Message mixo 2004-06-09 06:24:25 Last insert id