Re: Does PostgreSQL ever create indexes on its own? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Does PostgreSQL ever create indexes on its own?
Date
Msg-id 20151112223414.GT614468@alvherre.pgsql
Whole thread Raw
In response to Re: Does PostgreSQL ever create indexes on its own?  (Thomas Kellerer <spam_eater@gmx.net>)
List 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
createdmanually. 

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


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Does PostgreSQL ever create indexes on its own?
Next
From: Tom Lane
Date:
Subject: Re: Does PostgreSQL ever create indexes on its own?