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

Allow empty string value for config entries #1603

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antaflos
Copy link
Contributor

@antaflos antaflos commented Jul 5, 2024

Summary

PostgreSQL supports and allows config entries, such as those in postgresql.conf, to be set to the empty string. The postgresql::server::config_entry defined type, however, requires String[1] when supplying string values. This doesn't allow for the empty string.

This change relaxes the allowed data types for the value parameter of postgresql::server::config_entry to String from String[1] and adds a spec test to support the change.

Related Issues (if any)

#1602

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@antaflos
Copy link
Contributor Author

antaflos commented Jul 5, 2024

I don't think I can do anything about the failing tests (labeller and mend). The rest looks good.

@bastelfreak
Copy link
Collaborator

@antaflos can you please document in the spec test some examples of options where this makes sense? And please rebase after #1599 got merged.

@antaflos
Copy link
Contributor Author

@bastelfreak Will do. Our use case for empty strings here is that we have applications that use transaction-bound session variables, as in SET LOCAL awsome_app.auth_user_id = 123456 and SET LOCAL awesome_app.tenant_id = 893745. This pertains to auditability and row-level security.

PostgreSQL 13 (and possibly newer versions also) requires such session variables to be defined beforehand and initialised with a default value, such as the empty string, in postgresql.conf.

PostgreSQL supports and allows config entries, such as those in
postgresql.conf, to be set to the empty string. The
`postgresql::server::config_entry` defined type, however, requires
String[1] when supplying string values. This doesn't allow for the empty
string.

This change relaxes the allowed data types for the `value` parameter of
`postgresql::server::config_entry` to `String` from `String[1]` and adds
a spec test to support the change.

Fixes puppetlabs#1602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants