puppetlabs-postgresql icon indicating copy to clipboard operation
puppetlabs-postgresql copied to clipboard

Allow empty string value for config entries

Open antaflos opened this issue 1 year ago • 9 comments

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)

antaflos avatar Jul 05 '24 14:07 antaflos

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

antaflos avatar Jul 05 '24 15:07 antaflos

@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 avatar Jul 12 '24 08:07 bastelfreak

@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.

antaflos avatar Aug 14 '24 09:08 antaflos

So this has been open for a long while now. Any chance to get it merged?

antaflos avatar Jan 20 '25 17:01 antaflos

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.

antaflos avatar Apr 21 '25 23:04 antaflos

@ekohl Thank you for taking the time to look at and review this!

antaflos avatar Apr 22 '25 16:04 antaflos

CI is busted because Perforce is still using ubuntu-20.04. I think we should wait until they fix that

ekohl avatar Apr 22 '25 18:04 ekohl

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.

antaflos avatar Jun 05 '25 13:06 antaflos

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

antaflos avatar Oct 10 '25 16:10 antaflos