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

set_user/set_user_u only sets log_statement='all' if superuser #84

Open
cbrianpace opened this issue Aug 22, 2024 · 1 comment
Open
Assignees

Comments

@cbrianpace
Copy link

When using set_user or set_user_u, it appears that log_statement is only set to 'all' if the user is escalating to a superuser. Reading the documents, it appears that the intent is log_statement is always set to 'all' as long as set_user.block_log_statement is set to true/on.

Shouldn't log_statement always be set to all?

$ psql -h localhost -d hrlab -U sec_user
psql (16.3 (Homebrew))
Type "help" for help.

hrlab=> show log_statement;
log_statement

none
(1 row)

hrlab=> select set_user_u('postgres');
set_user_u

OK
(1 row)

hrlab=# show log_statement;
log_statement

all
(1 row)

hrlab=# select reset_user();
reset_user

OK
(1 row)

hrlab=> show log_statement;
log_statement

none
(1 row)

hrlab=> select set_user_u('hrapp');
set_user_u

OK
(1 row)

hrlab=> show log_statement;
log_statement

none
(1 row)

hrlab=> select reset_user();
reset_user

OK
(1 row)

hrlab=> select set_user('hrapp');
set_user

OK
(1 row)

hrlab=> show log_statement;
log_statement

none
(1 row)

@dwsteele dwsteele self-assigned this Sep 25, 2024
@dwsteele
Copy link
Collaborator

According to 0c78666 the current behavior is correct. However, the documentation for the original behavior was incompletely deleted and later restored by mistake. See #85.

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

2 participants