pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: p.otoole@uwyo.edu
Subject: Documentation of pg_index.indcollation missing some info in older versions?
Date: Thu, 21 Jun 2018 22:35:38 +0000
Message-ID: <152962053817.1255.17211424876113163924@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/catalog-pg-index.html
Description:

Hi, all.

While working on some scripts to identify missing indexes and add them to a
given table, I was a little confused by some entries in pg_index's
"indcollation" column like:

indexrelid     | 659423
indrelid       | 44520
indnatts       | 2
indisunique    | t
indisprimary   | f
indisexclusion | f
indimmediate   | t
indisclustered | f
indisvalid     | t
indcheckxmin   | f
indisready     | t
indislive      | t
indisreplident | f
indkey         | 5 3
indcollation   | 0 0
[...]

because 0::OID does not reference a valid pg_collation.oid.

In the IRC, Zr40 helpfully pointed out that the latest documentation readily
clarifies: "For each column in the index key, this contains the OID of the
collation to use for the index, or zero if the column is not of a collatable
data type."

However, I'm using 9.6 and was looking at the matching documentation at
https://www.postgresql.org/docs/9.6/static/catalog-pg-index.html
That page doesn't currently include this note; for 9.6, it only says "For
each column in the index key, this contains the OID of the collation to use
for the index" which had me confused about what I was seeing.

I believe the use of OID 0 in this form has been in place for a long time,
but only the current 9.10 docs say anything about it.

Since I currently run 9.6, I can confirm that the behavior reaches back at
least that far. 

For those who generally look at the matching documentation-version as the
database they're running, it would be helpful if the note found in 9.10's
pg_index doc could be included on the relevant previous versions as well.

Thanks!
- Patrick O'Toole

Application Developer
Wyoming Natural Diversity Database
UW Berry Biodiversity Conservation Center
Department 3381, 1000 E. University Av.
Laramie, WY 82071
P: 307-766-3018


view thread (2+ messages)  latest in thread

Message-ID: <152962053817.1255.17211424876113163924@wrigleys.postgresql.org>
Permalink:  ../152962053817.1255.17211424876113163924@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/152962053817.1255.17211424876113163924@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, p.otoole@uwyo.edu
  Subject: Re: Documentation of pg_index.indcollation missing some info in older versions?
  In-Reply-To: <152962053817.1255.17211424876113163924@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox