pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedDocumentation of pg_index.indcollation missing some info in older versions?
2+ messages / 2 participants
[nested] [flat]
* Documentation of pg_index.indcollation missing some info in older versions?
@ 2018-06-21 22:35 PG Doc comments form <noreply@postgresql.org>
2018-07-07 08:51 ` Re: Documentation of pg_index.indcollation missing some info in older versions? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2018-06-21 22:35 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: p.otoole@uwyo.edu
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Documentation of pg_index.indcollation missing some info in older versions?
2018-06-21 22:35 Documentation of pg_index.indcollation missing some info in older versions? PG Doc comments form <noreply@postgresql.org>
@ 2018-07-07 08:51 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2018-07-07 08:51 UTC (permalink / raw)
To: p.otoole@uwyo.edu; pgsql-docs@lists.postgresql.org
On 22.06.18 00:35, PG Doc comments form wrote:
> 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."
It's a standard convention in the PostgreSQL system catalogs that OID
zero means "none". There are likely many places where this is not
explicitly documented.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-07-07 08:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 22:35 Documentation of pg_index.indcollation missing some info in older versions? PG Doc comments form <noreply@postgresql.org>
2018-07-07 08:51 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
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