News for hackers. Stuff that matters.
Re:A Curated Guide to PostgreSQL by james4k on Tuesday April 24, 2012 @03:13PM (#3885803)
> Its of note that Postgres does not automatically create an index when creating the primary key, it is a separate step which you must do if not using an ORM. (http://postgresguide.com/performance/indexes.html#primary-ke...)

This directly contradicts with what the PostgreSQL documentation says.

> Adding a primary key will automatically create a unique btree index on the column or group of columns used in the primary key. (http://www.postgresql.org/docs/9.1/interactive/ddl-constrain...)

Is there a fundamental difference to the default pkey index versus an explicitly created index?

Re:A Curated Guide to PostgreSQL by joevandyk on Tuesday April 24, 2012 @03:24PM (#3885861)
perhaps he meant a foreign key, not primary key.

postgresql doesn't automatically create indexes for foreign keys.

> Is there a fundamental difference to the default pkey index versus an explicitly created index?

i don't know of any in practice.

Re:A Curated Guide to PostgreSQL by craigkerstiens on Tuesday April 24, 2012 @03:45PM (#3885987)
You're correct it was intended to be foreign keys, correctly updated now.

I believe the difference would be on the constraint. A primary key is intended to be unique, where as an index does not alway carry that constraint.

Re:A Curated Guide to PostgreSQL by jeltz on Tuesday April 24, 2012 @07:36PM (#3886905)
A primary key is the same thing as a unique index (any index which enforces unique entries) + a not null constraint.

It might make a difference in the heuristic for finding functional dependencies for group by though. This feature was introduced in 9.1 and allows one to not always have to list all columns in the GROUP BY clause.