Re: Why does Postgres allow duplicate (FK) constraints - Mailing list pgsql-general

From Kevin Grittner
Subject Re: Why does Postgres allow duplicate (FK) constraints
Date
Msg-id 1364401437.21067.YahooMailNeo@web162903.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: Why does Postgres allow duplicate (FK) constraints  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> wrote:
> 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.

I once saw a case where this needed to be done because the
dependency information somehow became inconsistent.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: Understanding behavior of SELECT with multiple unnested columns
Next
From: hamann.w@t-online.de
Date:
Subject: Re: pltcl and modules question