-
Notifications
You must be signed in to change notification settings - Fork 249
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
chore: admit general PG booleans for configuration #4494
Conversation
❗ By default, the pull request is configured to backport to all release branches.
|
/test limit=local feature_type=smoke |
@jsilvela, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/9016748274 |
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.
I don't think it's correct to have two different functions (IsTrue and IsFalse) to parse a Postgres boolean.
We should have a single function func ParsePostgresBoolean(in string) (bool, error)
and then manage the parse errors in the webhook.
Also, the PostgreSQL documentation says "Values can be written as on, off, true, false, yes, no, 1, 0 (all case-insensitive) or any unambiguous prefix of one of these.", and this implementation doesn't recognise "unambiguous prefixes".
What is an "unambiguous prefix"? I've been looking for explanations or examples and found none. |
Because strictly speaking, an unambiguous prefix could be "fa", or "of". Is that something we really want? |
Postgres does it https://doxygen.postgresql.org/bool_8c_source.html#l00036 |
Realized, |
Beside my suggestion, PR looks good to me. |
You are right. Archive mode can only be |
c4c12a4
to
e42e3f4
Compare
c36e8a2
to
ae87bac
Compare
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
While it generally allow surrounding spaces when parsing booleans in SQL, they are not permitted in the configuration file. Adding a space before or after a value will cause the following log entry on the reload and a failure on the restart: { "level": "info", "ts": "2024-05-20T12:10:40Z", "logger": "postgres", "msg": "record", "logging_pod": "cluster-example-1", "record": { "log_time": "2024-05-20 12:10:40.498 UTC", "process_id": "1348", "session_id": "664b3da9.544", "session_line_num": "9", "session_start_time": "2024-05-20 12:10:17 UTC", "transaction_id": "0", "error_severity": "LOG", "sql_state_code": "22023", "message": "parameter \"wal_log_hints\" requires a Boolean value", "backend_type": "postmaster", "query_id": "0" } } Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Allows any valid Postgres boolean for configuration in the webhooks. Currently, only `off` and `on` are properly understood by the webhooks. Closes #4252 Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> (cherry picked from commit 9a09548)
Allows any valid Postgres boolean for configuration in the webhooks. Currently, only `off` and `on` are properly understood by the webhooks. Closes #4252 Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> (cherry picked from commit 9a09548)
Allows any valid Postgres boolean for configuration in the webhooks. Currently, only `off` and `on` are properly understood by the webhooks. Closes #4252 Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com> (cherry picked from commit 9a09548)
Allows any valid Postgres boolean for configuration in the webhooks.
Currently, only "off" and "on" are properly understood by the webhooks.
Closes #4252