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

Hardcoded postgrest_test_authenticator in latest nightly #1740

Closed
LorenzHenk opened this issue Jan 25, 2021 · 4 comments · Fixed by #1743
Closed

Hardcoded postgrest_test_authenticator in latest nightly #1740

LorenzHenk opened this issue Jan 25, 2021 · 4 comments · Fixed by #1743
Assignees
Labels

Comments

@LorenzHenk
Copy link

LorenzHenk commented Jan 25, 2021

Environment

  • PostgreSQL version: 13.1
  • PostgREST version: nightly-2021-01-22-15-56-6557f1f

Description of issue

In the latest nightly, when trying to run postgrest --dump-config, I get the following error:

$ postgrest --dump-config

An error ocurred when trying to query database settings for the config parameters:
SessionError (QueryError "\n      with\n      role_setting as (\n        select unnest(setconfig) as setting from pg_catalog.pg_db_role_setting where setrole = 'postgrest_test_authenticator'::regrole::oid\n      ),\n      kv_settings as (\n        select split_part(setting, '=', 1) as key, split_part(setting, '=', 2) as value from role_setting\n      )\n      select replace(key, 'pgrst.', '') as key, value from kv_settings where key like 'pgrst.%';\n    " [] (ResultError (ServerError "42704" "role \"postgrest_test_authenticator\" does not exist" Nothing Nothing)))

Seems like the role "postgrest_test_authenticator" was hardcoded here:

select unnest(setconfig) as setting from pg_catalog.pg_db_role_setting where setrole = 'postgrest_test_authenticator'::regrole::oid

Related: #1729

The same error also appears on postgrest --dump-schema, but the schema JSON is still printed.

@wolfgangwalther
Copy link
Member

Wow. I wonder how I missed that in my review of that PR :D.

Should be enough to replace 'postgrest_test_authenticator' with current_user.

@steve-chavez
Copy link
Member

steve-chavez commented Jan 25, 2021

@LorenzHenk Set db-load-guc-config = false to fix the error. (for now.. I'll make a PR)

@steve-chavez steve-chavez self-assigned this Jan 25, 2021
@LorenzHenk
Copy link
Author

Thanks for the quick answers!

@steve-chavez
Copy link
Member

@LorenzHenk The latest postgrest-nightly-2021-01-25-18-38-c93e8f9 on Nightly builds should have this one fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants