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

log_min_messages requires elevated privileges #614

Open
nkreiger opened this issue Jul 2, 2023 · 1 comment
Open

log_min_messages requires elevated privileges #614

nkreiger opened this issue Jul 2, 2023 · 1 comment

Comments

@nkreiger
Copy link

nkreiger commented Jul 2, 2023

Chore

Describe the chore

In order to set the parameter log_min_messages you need elevated privileges,

These privileges cannot be achieved in certain managed Cloud SQL instances. It would be great to wrap this in a function, or maybe check the permissions before running it?

Additional context

Maybe something like this, or something smarter

DO $$
BEGIN
BEGIN
-- Attempt to set the parameter
EXECUTE 'SET log_min_messages TO ''fatal''';
RAISE NOTICE 'log_min_messages set to ''fatal''';
EXCEPTION
WHEN others THEN
-- Handle the error when privileges are insufficient
RAISE NOTICE 'You do not have the required privileges to set log_min_messages';
END;
END $$

@nkreiger
Copy link
Author

nkreiger commented Jul 5, 2023

Any thoughts about this? I can line up a PR if there is no objection?

#617

for review

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

No branches or pull requests

1 participant