Skip to content

sql: fix the column pg_index.indclass #26504

@knz

Description

@knz

PostgreSQL specifies pg_index.indclass to be an OIDVECTOR.
CockroachDB currently sets it to INT.

As per https://www.postgresql.org/docs/10/static/catalog-pg-index.html:

For each column in the index key, this contains the OID of the operator class to use. See pg_opclass for details

Needed to support the following query listed in #16971:

        SELECT
            indexrelid,
            (information_schema._pg_expandarray(indclass)).x AS operator_argument_type_oid,
            (information_schema._pg_expandarray(indclass)).n AS operator_argument_position
        FROM
            pg_index

with the changes in #26503

cc @jordanlewis

Metadata

Metadata

Assignees

Labels

A-sql-pgcompatSemantic compatibility with PostgreSQLC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions