community.postgresql 5.1.3 Released - Bugfixes for postgresql_alter_system, postgresql_db, postgresql_query and More

Beginner
2026-11-283By Luca Berton

Lesson 1 of 15 in Foundations

Introduction

community.postgresql is the Ansible collection that provides modules and plugins for managing PostgreSQL databases and clusters, including roles, databases, privileges, publications, extensions, and server configuration via ALTER SYSTEM. Version 5.1.3 has been published to Ansible Galaxy as a patch release following 5.1.2, containing only bugfixes to existing modules and plugins, with no new features or breaking changes.

Whats New

This release focuses almost entirely on postgresql_alter_system, with additional fixes for postgresql_db, postgresql_publication, and postgresql_query/postgresql_script.

postgresql_alter_system fixes

  • Boolean values are now compared across every spelling PostgreSQL accepts (true, yes, 1, etc.), and enum values are compared case-insensitively. Setting the same value again in a different spelling or case (for example WARNING for log_min_messages) no longer reports a spurious change (PR #998).
  • Parameters of type real are now compared as floating point numbers using the 6 significant digits shown by pg_settings. Previously, values such as 1.0 failed with cannot be converted to int, and parameters shown in scientific notation (for example 1e-05) always failed. Real-type parameters with a time unit, such as vacuum_cost_delay, now correctly accept fractional values (PR #997).
  • output_plugin_libraries (PostgreSQL 14.24, 15.19, 16.15, 17.11, 18.6 and later) and oauth_validator_libraries (PostgreSQL 18+) are now treated as GUC_LIST_QUOTE list parameters, so re-applying the same list no longer reports a change (PR #996).
  • When a parameter is set at role, database, connection, or session level (ALTER ROLE/DATABASE ... SET, ALTER ROLE ALL ... SET), the module now compares the desired value against the value stored in the configuration files instead of the current session value from pg_settings. Previously this could cause the module to report no change and leave the server configuration untouched (PR #999).

Other module fixes

  • postgresql_db - errors from psql or pg_restore during a compressed dump restore are now properly reported. Previously, if the restore program exited early (for example due to an unknown option in target_opts or a failed login), the decompressor would die with SIGPIPE and the module returned rc=-13 with an empty message (issue #916).
  • postgresql_publication - fixed change detection for publish_via_partition_root (PR #984).
  • postgresql_query, postgresql_script - lists of strings passed in positional_args or named_args are now quoted as PostgreSQL array elements instead of embedding Python's single quotes literally (issue #411).
  • postgresql_query, postgresql_script - None elements inside a list passed in positional_args or named_args are now sent as SQL NULL instead of the literal string None, which previously got stored as text in a text array and failed outright for other array types such as int[].

How to Test

Install or upgrade the collection from Ansible Galaxy and confirm the version is reported correctly.

# Install the latest version
ansible-galaxy collection install community.postgresql --upgrade

# Or pin the exact version
ansible-galaxy collection install community.postgresql:==5.1.3

# Verify the installed version
ansible-galaxy collection list community.postgresql
ComponentPrevious versionNew version
community.postgresql5.1.25.1.3

After upgrading, it is worth re-running playbooks that use postgresql_alter_system with real-type or list-type GUC parameters, as well as any that rely on postgresql_query/postgresql_script with array arguments containing None values, to confirm the previously reported false changes no longer appear.