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

postgresql::server::config_entry should allow the empty string for value parameter #1602

Open
antaflos opened this issue Jul 5, 2024 · 0 comments

Comments

@antaflos
Copy link
Contributor

antaflos commented Jul 5, 2024

Describe the Bug

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.

Expected Behavior

The postgresql::server::config_entry defined type should allow the empty string for its value parameter.

Steps to Reproduce

A typical use case is setting database-specific parameters that can be empty:

postgresql::server::config_entry { 'my_database.important_parameter':
  value => ''
}

This should render as follows in postgresql.conf, which is valid from PostgreSQL's PoV.

my_database.important_parameter = ''

However, the Puppet agent run fails with an error message:

Postgresql::Server::Config_entry[my_database.important_parameter]: parameter 'value' expects a value of type Undef, String[1], Numeric, or Array[String[1]], got String

This is because the empty string is not allowed here.

Environment

  • Version 10.3.0
  • Platform Ubuntu 20.04, 22.04
antaflos added a commit to antaflos/puppet-postgresql that referenced this issue Jul 5, 2024
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
antaflos added a commit to antaflos/puppet-postgresql that referenced this issue Aug 14, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants