Skip to content

sql: pg_attribute does not report stored columns on indexes #88107

@knz

Description

@knz

Needed for #88061

Describe the problem

CockroachDB does not include stored columns in pg_attribute

To Reproduce

Initialize with:

create table mytable(x int, y int);
create index myidx on mytable(x) include(y);

Then run \d myidx using psql, on both PostgreSQL and CockroachDb.

In pg, the (correct) output is:

         Index "public.myidx"
 Column |  Type   | Key? | Definition
--------+---------+------+------------
 x      | integer | yes  | x
 y      | integer | no   | y

In CockroachDB:

  Column |  Type  | Key? | Definition
---------+--------+------+-------------
  x      | bigint | yes  | x

Notice how y is not listed.

Jira issue: CRDB-19691

Epic: CRDB-23454

Metadata

Metadata

Assignees

Labels

A-sql-pgcatalogA-sql-pgcompatSemantic compatibility with PostgreSQLA-sql-vtablesVirtual tables - pg_catalog, information_schema etcC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions