-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix postgresql_set module if single-value param contains comma in value #400
Conversation
would still be handled incorrectly, yes? |
Hi hunleyd, the parameters pgaudit.log and pgaudit.log_relation are not affected by my PR. Small example with python3 and pg 12.13 (from postgres user):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RealGreenDragon hi, welcome and thanks for the PR!
A couple of minor things from me.
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
@Andersson007 Suggestions applied, thank you very much! |
thx @RealGreenDragon ! |
Backport to stable-1: 💚 backport PR created✅ Backport PR branch: Backported as #403 🤖 @patchback |
@RealGreenDragon thanks for the contribution! @hunleyd @jchancojr thanks for reviewing! @RealGreenDragon if you're not in the #postgresql:ansible.com room on Matrix yet, welcome! |
SUMMARY
The PR #357 fix the multi-value parameters management (issue #78), but the new check assumes as multi-value each parameter with a comma in the value, that is incorrect as there are single-value parameters with comma in value.
If a single-value parameter is treated as a multi-value, the 'param_set' function builds an ALTER SYSTEM SET command with multiple comma-separated values, that fails with the message:
Single-value parameters with possible comma in value are "_command" and "_prefix" that for exmple in v12 are:
The most critical (that I add in tests) is 'log_line_prefix' because often it contains comma and a space at the end.
I simply fix the check to evaluate as single-value all parameters that ends with '_command' and '_prefix'.
If the fix is accepted, It can be back-ported also in stable branch.
ISSUE TYPE
COMPONENT NAME
postgresql_set