Introduction

community.postgresql is the Ansible collection that provides modules and plugins for managing PostgreSQL databases, roles, extensions, privileges, and server configuration from Ansible playbooks. Version 5.1.1 is a patch release that lands on top of 5.1.0 with four targeted bugfixes to postgresql_alter_system, postgresql_db, postgresql_ping, and postgresql_table. No new features, no breaking changes.

Whats New

Bugfixes

  • postgresql_alter_system - configuration parameter name components are now consistently quoted in ALTER SYSTEM SET and RESET statements, preserving case and supporting quoted and unquoted names containing SQL keywords such as online_analyze.verbose (issue #940).
  • postgresql_db - the inherited environment (for example PGSSLMODE, PGSSLROOTCERT, or PATH) is now preserved when restoring a compressed dump with login_password set. Previously, the restore command's environment was replaced by PGPASSWORD alone, causing it to differ from the uncompressed restore path.
  • postgresql_ping - beta and release-candidate server versions are now correctly handled when parsing the version number, avoiding parsing failures against non-GA PostgreSQL servers.
  • postgresql_table - the persistence of an existing table can now be changed with ALTER TABLE ... SET UNLOGGED or ALTER TABLE ... SET LOGGED when unlogged is set explicitly and differs from the current state. unlogged no longer defaults to false, so existing tables are left unchanged when the option is not set (issue #878).

Module/Plugin Summary

ComponentChange
postgresql_alter_systemFixed quoting of parameter name components in SET/RESET
postgresql_dbPreserve inherited environment during compressed dump restore
postgresql_pingCorrectly parse beta/rc server version strings
postgresql_tableunlogged no longer defaults to false; respects explicit value only

How to Test

Install or upgrade the collection from Ansible Galaxy and verify the version:

ansible-galaxy collection install community.postgresql:==5.1.1

ansible-galaxy collection list community.postgresql

To confirm the fixes are in place, review the installed changelog fragment:

cat $(ansible-galaxy collection list community.postgresql --format json \
  | python3 -c "import json,sys; print(list(json.load(sys.stdin).values())[0]['community.postgresql']['path'])")/community/postgresql/CHANGELOG.rst | head -40

A quick functional check against postgresql_alter_system with a quoted parameter name containing a dot, and postgresql_table with unlogged deliberately unset against a pre-existing table, are good regression tests for this release.

Conclusion

Community.postgresql 5.1.1 is a small, focused patch release. Anyone running postgresql_db restores with custom SSL environment variables, postgresql_alter_system against parameters with dotted/keyword names, or postgresql_table with unlogged left at its default should upgrade to avoid the behaviors described above.