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

pg_catalog.pg_user schema changed #15250

Closed
huangjw806 opened this issue Feb 26, 2024 · 4 comments · Fixed by #15288
Closed

pg_catalog.pg_user schema changed #15250

huangjw806 opened this issue Feb 26, 2024 · 4 comments · Fixed by #15288
Milestone

Comments

@huangjw806
Copy link
Contributor

This is the query cloud currently uses to retrieve RW users:
https://github.com/risingwavelabs/risingwave-cloud/blob/f284f602a5fe097d9e230a809546576ffdd6ee30/mgmt/internal/risingwave/rwdb/user.go#L102

SELECT * FROM pg_catalog.pg_user WHERE name != 'root' AND name != 'postgres';
ERROR:  Failed to run the query

Caused by these errors (recent errors listed first):
  1: Failed to bind expression: name <> 'root' AND name <> 'postgres'
  2: Item not found: Invalid column: name

schema of the current table:

SELECT * FROM pg_catalog.pg_user;
 usesysid | usename  | usecreatedb | usesuper |  passwd
----------+----------+-------------+----------+----------
        1 | root     | t           | t        | ********
        2 | postgres | t           | t        | ********

If we change the scheme for system tables, I think we should try to synchronize it to the cloud, or have relevant documentation.

@github-actions github-actions bot added this to the release-1.7 milestone Feb 26, 2024
@huangjw806
Copy link
Contributor Author

caused by this pr:
#14947

@yezizp2012
Copy link
Member

Oh, this should have been defined incorrectly when it was defined before. It should be consistent with PostgreSQL and has been fixed in the recent refactoring. We should be careful about the schema changes for system catalogs and should synchronize it to the cloud if necessary.

@huangjw806
Copy link
Contributor Author

Oh, this should have been defined incorrectly when it was defined before. It should be consistent with PostgreSQL and has been fixed in the recent refactoring. We should be careful about the schema changes for system catalogs and should synchronize it to the cloud if necessary.

This may require version control for cloud to distinguish them.

@wjf3121
Copy link

wjf3121 commented Feb 26, 2024

@yezizp2012, I left some question in the cloud linear issue: https://linear.app/risingwave-labs/issue/CLOUD-2423/bug-adapt-the-schema-change-of-the-pg-user-system-table#comment-e7c425aa

PTAL when you have time.

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 a pull request may close this issue.

3 participants