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

chore(catalog): avoid rw_catalog in pg_tables #16915

Merged
merged 1 commit into from
May 24, 2024

Conversation

KeXiangWang
Copy link
Contributor

@KeXiangWang KeXiangWang commented May 24, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Avoid the rw_catalog.rw_* tables in the pg_catalog.pg_tables.

The reason for this is that metabase will list all the normal tables by filtering out pg_catalog.pg_* and information schema.* from the result of pg_catalog.pg_tables and check the privileges of these tables using has_table_privileges. has_table_privilege requires the table's oid to check privileges. Some of rw_catalog.rw_ have no oid, as a result, metabase will stuck at syncing tables stage due to the failure of has_table_privilege check. So to avoid this, I removed all the rw_catalog.rw_* tables from pg_catalog.pg_tables's result.

It makes sense because when a user use pg_catalog.pg_tables, he wants to see the result just like postgres. Hiding tables under rw_catalog makes the experience aligned. Or if you have any better idea, please feel free to comment.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@neverchanje
Copy link
Contributor

Thanks for this investigation. The workaround LGTM as it will not affect the overall user experience.

Some of rw_catalog.rw_ have no oid

However, I feel this issue like what should be fixed. @yezizp2012 I wonder why rw_tables don't have an associated oid?

@KeXiangWang KeXiangWang added this pull request to the merge queue May 24, 2024
Merged via the queue into main with commit 925c44e May 24, 2024
40 of 41 checks passed
@KeXiangWang KeXiangWang deleted the wkx/avoid-rw-catalog-in-pg-tables branch May 24, 2024 03:09
github-merge-queue bot pushed a commit that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants