Skip to content

Add the referential_constraints view to information schema #2637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

spencerkimball
Copy link
Member

Update all information schema tables to match implementations, including
updating the meanings of _CATALOG and _SCHEMA columns.

From my review, other incomplete items in information_schema that
require fixes:

  • CHARACTER_SET_* and GENERATION_EXPRESSION in columns table.
  • administrable_role_authorizations
  • applicable_roles
  • column_privileges
  • enabled_roles
  • role_table_grants
  • sequences
  • statistics table needs IMPLICIT defined.

See #2017

Fixes #2508

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@spencerkimball
Copy link
Member Author

+cc @knz

@cockroach-teamcity
Copy link
Member

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this.
Mostly good, except for a bug in views.

paging @nvanbenschoten for additional control

@@ -168,8 +189,8 @@ The `views` view identifies [views](views.html) in the cluster.

Column | Description
-------|-----------
`TABLE_CATALOG` | Always equal to `def` (CockroachDB does not support the notion of catalogs).
`TABLE_SCHEMA` | Name of the database that the view reads from.
`TABLE_CATALOG` | Name of the database that the view reads from.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the original doc text and the new one are incorrect. the table_xxx columns in this table refer to the view itself, not the table(s) being read from. A view can read from multiple tables.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@cockroach-teamcity
Copy link
Member

@spencerkimball
Copy link
Member Author

Could somebody tell me what the CI failure here means / what I should do to correct it?

Copy link
Contributor

@jseldess jseldess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, @spencerkimball!

Update all information schema tables to match implementations, including
updating the meanings of `_CATALOG` and `_SCHEMA` columns.

From my review, other incomplete items in information_schema that
require fixes:
- CHARACTER_SET_* and GENERATION_EXPRESSION in `columns` table.
- administrable_role_authorizations
- applicable_roles
- column_privileges
- enabled_roles
- role_table_grants
- sequences
- `statistics` table needs `IMPLICIT` defined.

See cockroachdb#2017

Fixes cockroachdb#2508
@cockroach-teamcity
Copy link
Member

@spencerkimball spencerkimball merged commit 10b37a9 into cockroachdb:master Mar 8, 2018
@spencerkimball spencerkimball deleted the fix-2508 branch March 8, 2018 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: Add information_schema.referential_constraints table
5 participants