Re: Why does Postgres allow duplicate (FK) constraints

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why does Postgres allow duplicate (FK) constraints
Date: 2013-03-27 08:54:03
Message-ID: kiuc18$9s$2@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys, 26.03.2013 17:17:
> It can make sense during a maintenance window, if you create a new
> (redundant) FK constraint concurrently to replace the existing one.
> If you'd first remove the existing constraint, you're allowing FK
> violations until the new constraint has finished creating its index.
>
> This happens for example if you want to use a different index
> algorithm, say a gist index instead of a btree index, or if the
> initial index has gotten corrupt somehow and it needs reindexing.

I can understand this for indexes, but a foreign key constraint does not create one.

Regards
Thomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-03-27 14:03:12 Re: Understanding behavior of SELECT with multiple unnested columns
Previous Message Thomas Kellerer 2013-03-27 08:51:50 Re: Why does Postgres allow duplicate (FK) constraints