Re: Does PostgreSQL ever create indexes on its own?

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Does PostgreSQL ever create indexes on its own?
Date: 2015-11-12 22:34:14
Message-ID: 20151112223414.GT614468@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer wrote:
> Doiron, Daniel schrieb am 12.11.2015 um 23:21:
> >I’m troubleshooting a schema and found this:
> >
> >Indexes:
> > "pk_patient_diagnoses" PRIMARY KEY, btree (id)

> The only index that Postgres "automatically" creates is the unique index supporting a primary key or a unique constraint.
>
> But apart from that, Postgres never creates indexes on its own.
>
> So from the list above, only pk_patient_diagnose has (most probably) been created automatically. Everything else was created manually.

As I recall, the naming convention is to append "_pkey", not to prepend
"pk_", so not even that one. (Of course, you can tell it what name to
use when creating the constraint, which is what was done here.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-11-12 22:38:23 Re: Does PostgreSQL ever create indexes on its own?
Previous Message Thomas Kellerer 2015-11-12 22:26:06 Re: Does PostgreSQL ever create indexes on its own?