Re: Ideas to deal with table corruption

From: Corey Taylor <corey(dot)taylor(dot)fl(at)gmail(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Luis Marin <luismarinaray(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Ideas to deal with table corruption
Date: 2018-01-06 19:11:44
Message-ID: CADBz387cdv6JgKt7PqJa=6Lf7dVepq+DMpi5=m_tijJHS=RNmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Sat, Jan 6, 2018 at 12:30 PM, Melvin Davidson <melvin6925(at)gmail(dot)com>
wrote:

>
> *Don't forget to create indexes on the FK's in the table they reference!*
>
>
> *Also, it would be nice to know the PostgreSQL version and O/S.*
>

Is it possible for an index to not exist on those columns?

https://www.postgresql.org/docs/current/static/ddl-constraints.html#DDL-CONSTRAINTS-FK

"A foreign key must reference columns that either are a primary key or form
a unique constraint. This means that the referenced columns always have an
index (the one underlying the primary key or unique constraint); so checks
on whether a referencing row has a match will be efficient."

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message scott ribe 2018-01-06 19:14:56 Re: Ideas to deal with table corruption
Previous Message Melvin Davidson 2018-01-06 18:30:02 Re: Ideas to deal with table corruption

Browse pgsql-general by date

  From Date Subject
Next Message scott ribe 2018-01-06 19:14:56 Re: Ideas to deal with table corruption
Previous Message Melvin Davidson 2018-01-06 18:30:02 Re: Ideas to deal with table corruption