Skip to content
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

sql: improve output table of SHOW GRANTS #119775

Closed
fabiog1901 opened this issue Feb 29, 2024 · 1 comment · Fixed by #122197
Closed

sql: improve output table of SHOW GRANTS #119775

fabiog1901 opened this issue Feb 29, 2024 · 1 comment · Fixed by #122197
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-starter Might be suitable for a starter project for new employees or team members. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@fabiog1901
Copy link
Contributor

fabiog1901 commented Feb 29, 2024

The output table of command SHOW GRANTS lists object in a hierarchical fashion: database_name, schema_name, relation_name.

Recently however, we have introduced 3 more object types - TYPE, FUNCTION, EXTERNAL CONNECTION - and these are listed under the relation_name column, which is slightly incorrect.

This FR to request a review of the output table and consider maybe using a object_type and object_name to identify the object as a UDF, TYPE or TABLE.

slack

Jira issue: CRDB-36306

Epic CRDB-37763

@fabiog1901 fabiog1901 added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Feb 29, 2024
@blathers-crl blathers-crl bot added this to Triage in SQL Foundations Feb 29, 2024
@rafiss rafiss added the E-starter Might be suitable for a starter project for new employees or team members. label Mar 5, 2024
@zyf123123
Copy link
Contributor

Should we modify
database_name schema_name table_name grantee privilege_type is_grantable
into
database_name schema_name object_name object_type grantee privilege_type is_grantable
or something else? I think many logictest format need to modify

Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Apr 11, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: cockroachdb#119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Apr 15, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: cockroachdb#119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
craig bot pushed a commit that referenced this issue Apr 17, 2024
122197: sql/delegate: added object_type and object_name to show grants r=Dedej-Bergin a=Dedej-Bergin

Previously, we used the relation_name column to show all objects however we now have objects such as function and types that are not relations so the name of this column was changed to object_name in these code changes. Additionally with the larger variety in types a new column object_type is added that identifies the type of an object.

Fixes: #119775
Release note (sql change): object_type can now be seen with the show grants command and relation_name column is now shown as object_name.

Co-authored-by: Bergin Dedej <bergin.dedej@cockroachlabs.com>
@craig craig bot closed this as completed in a9fde23 Apr 17, 2024
SQL Foundations automation moved this from Triage to Done Apr 17, 2024
Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Apr 19, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: cockroachdb#119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
cockroach-dev-inf pushed a commit that referenced this issue Apr 19, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: #119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
cockroach-dev-inf pushed a commit that referenced this issue Apr 22, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: #119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Apr 22, 2024
Previously, we used the relation_name column to show all objects
however we now have objects such as function and types that
are not relations so the name of this column was changed to object_name
in these code changes. Additionally with the larger variety in types
a new column object_type is added that identifies the type of an object.

Fixes: cockroachdb#119775
Release note (sql change): object_type can now be seen with the show grants
command and relation_name column is now shown as object_name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-starter Might be suitable for a starter project for new employees or team members. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
Development

Successfully merging a pull request may close this issue.

4 participants