Allow empty string value for config entries
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
- [x] 🟢 Spec tests.
- [ ] 🟢 Acceptance tests.
- [x] Manually verified. (For example
puppet apply)
I don't think I can do anything about the failing tests (labeller and mend). The rest looks good.
@antaflos can you please document in the spec test some examples of options where this makes sense? And please rebase after https://github.com/puppetlabs/puppetlabs-postgresql/pull/1599 got merged.
@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.
So this has been open for a long while now. Any chance to get it merged?
This is still open, even though approvals were given. What do I need to do to get this merged?
Some acceptance tests are failing, but apparently not because of my changes.
@ekohl Thank you for taking the time to look at and review this!
CI is busted because Perforce is still using ubuntu-20.04. I think we should wait until they fix that
This is like pulling teeth. The spec tests finally work, so I updated mine to fix Rubocop complaints.
But now the acceptance tests on Debian and Ubuntu are broken, because they can not install Puppet agent because of the expired GPG keys at apt.puppet.com.
This is getting worse all the time. Now none of the tests work because apparently they need to install Twingate first, but that fails with
W: GPG error: https://packages.twingate.com/apt InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C363F09A9174A9E