sql: use schema desc ID for OIDs in pg_catalog#88009
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Sep 16, 2022
Merged
sql: use schema desc ID for OIDs in pg_catalog#88009craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
Prior to this patch, a synthetic OID was used for
"namespace" (schema) references in `pg_catalog`.
This was making it difficult/impossible to retrieve
schema comments using a non-`root` SQL query, e.g. via
```sql
SELECT nspname AS schema,
substr(coalesce(pc.comment, sc.comment), e'[^\n]{0,40}') as description
FROM pg_catalog.pg_namespace t
LEFT OUTER JOIN system.comments sc
ON t.oid = sc.object_id AND sc.type = 4
LEFT OUTER JOIN crdb_internal.predefined_comments pc
ON t.oid = pc.object_id AND pc.type = 4
```
This patch fixes it.
Release note: None
97f9cd9 to
0140d75
Compare
rafiss
approved these changes
Sep 16, 2022
Collaborator
rafiss
left a comment
There was a problem hiding this comment.
this is a great idea
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)
Contributor
Author
|
thank you! bors r=rafiss |
Contributor
|
Build succeeded: |
This was referenced Sep 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needed for #87606.
Prior to this patch, a synthetic OID was used for
"namespace" (schema) references in
pg_catalog.This was making it difficult/impossible to retrieve schema comments using a non-
rootSQL query, e.g. viaThis patch fixes it.
Release note: None