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

Postgres: support schemas prefixed with "pg" #8435

Closed
BenoitRanque opened this issue Apr 25, 2022 · 3 comments
Closed

Postgres: support schemas prefixed with "pg" #8435

BenoitRanque opened this issue Apr 25, 2022 · 3 comments
Labels
c/console Related to console k/enhancement New feature or improve an existing feature

Comments

@BenoitRanque
Copy link
Contributor

Is your proposal related to a problem?

Hasura console does not currently display schemas when the schema name starts with pg.

The postgres documentation states that

Schema names beginning with pg_ are reserved for system purposes and cannot be created by users.

Describe the solution you'd like

Hasura console should show schemas beginning with pg (but not pg_)

@BenoitRanque BenoitRanque added k/enhancement New feature or improve an existing feature c/console Related to console labels Apr 25, 2022
@BenoitRanque
Copy link
Contributor Author

Note this may not be only a console issue.
Creating the metadata manually did not work, and lead to metadata inconsistency due to a missing table (despite the table existing)

@BenoitRanque
Copy link
Contributor Author

BenoitRanque commented Apr 26, 2022

This issue happens at least in part because the introspection query uses the following SQL:

  AND "table".table_schema NOT LIKE 'pg_%'

The _ character is a wildcard, and cant match any character. From the postgres documentation:

An underscore (_) in pattern stands for (matches) any single character

The _ character should be escaped like so:

  AND "table".table_schema NOT LIKE 'pg\_%'

This is most likely an oversight and not intentional.
I am opening a PR to fix this, but I do not believe this will be the end of the story.
Most likely the console also has sql statements with this mistake.

@gautamsi
Copy link

gautamsi commented Apr 28, 2022

I also have same issue, I use https://github.com/timgit/pg-boss which uses schema name pgboss

I wanted to connect hasura to pgboss database and use subscription to create some dashboard but stuck with this specific issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console Related to console k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants