Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ Community PostgreSQL Collection Release Notes

.. contents:: Topics

v4.2.0
======

Release Summary
---------------

This is a minor release of the ``community.postgresql`` collection.
This changelog contains all changes to the modules and plugins in this collection
that have been made after the previous release.

Minor Changes
-------------

- postgresql_privs - support MAINTAIN privilege on tables (added in PostgreSQL 17) (https://github.com/ansible-collections/community.postgresql/pull/888).

Bugfixes
--------

- postgresql_db - Fix connection limit not being set when value is "0" (https://github.com/ansible-collections/community.postgresql/issues/879).
- postgresql_db - fixed ``session_role`` parameter that was being ignored for raw connections (https://github.com/ansible-collections/community.postgresql/pull/865)
- postgresql_db - restoring from ``.sql`` files would execute the file twice. The module now avoids using both ``--file`` and stdin redirection simultaneously (https://github.com/ansible-collections/community.postgresql/issues/882).

v4.1.0
======

Expand Down
24 changes: 24 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,3 +1094,27 @@ releases:
- 4.1.0.yml
- 858-negated-change-report.yml
release_date: '2025-05-30'
4.2.0:
changes:
bugfixes:
- postgresql_db - Fix connection limit not being set when value is "0" (https://github.com/ansible-collections/community.postgresql/issues/879).
- postgresql_db - fixed ``session_role`` parameter that was being ignored for
raw connections (https://github.com/ansible-collections/community.postgresql/pull/865)
- postgresql_db - restoring from ``.sql`` files would execute the file twice.
The module now avoids using both ``--file`` and stdin redirection simultaneously
(https://github.com/ansible-collections/community.postgresql/issues/882).
minor_changes:
- postgresql_privs - support MAINTAIN privilege on tables (added in PostgreSQL
17) (https://github.com/ansible-collections/community.postgresql/pull/888).
release_summary: 'This is a minor release of the ``community.postgresql`` collection.

This changelog contains all changes to the modules and plugins in this collection

that have been made after the previous release.'
fragments:
- 4.2.0.yml
- 865-postgresql_db-session_role-fix.yml
- 879-fix-conn-limit-zero.yml
- 882-postgresql_db-restore-fix.yml
- 888-postgresql-priv-maintain.yml
release_date: '2025-12-04'
2 changes: 0 additions & 2 deletions changelogs/fragments/865-postgresql_db-session_role-fix.yml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/879-fix-conn-limit-zero.yml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/882-postgresql_db-restore-fix.yml

This file was deleted.

2 changes: 0 additions & 2 deletions changelogs/fragments/888-postgresql-priv-maintain.yml

This file was deleted.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: community
name: postgresql
version: 4.1.0
version: 4.2.0
readme: README.md
authors:
- Ansible PostgreSQL community
Expand Down
5 changes: 2 additions & 3 deletions plugins/module_utils/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.six import iteritems
from ansible_collections.community.postgresql.plugins.module_utils.version import \
LooseVersion

Expand Down Expand Up @@ -323,7 +322,7 @@ def get_conn_params(module, params_dict, warn_db_default=True):
module.warn('Database name has not been passed, '
'used default database to connect to.')

kw = dict((params_map[k], v) for (k, v) in iteritems(params_dict)
kw = dict((params_map[k], v) for (k, v) in params_dict.items()
if k in params_map and v != '' and v is not None)

# If a login_unix_socket is specified, incorporate it here.
Expand Down Expand Up @@ -505,7 +504,7 @@ def convert_elements_to_pg_arrays(obj):
obj (dict or list): Object with converted elements.
"""
if isinstance(obj, dict):
for (key, elem) in iteritems(obj):
for (key, elem) in obj.items():
if isinstance(elem, list):
obj[key] = list_to_pg_array(elem)

Expand Down
6 changes: 2 additions & 4 deletions plugins/module_utils/saslprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
in_table_d1, in_table_d2)
from unicodedata import normalize

from ansible.module_utils.six import text_type


def is_unicode_str(string):
return True if isinstance(string, text_type) else False
return True if isinstance(string, str) else False


def mapping_profile(string):
Expand Down Expand Up @@ -149,7 +147,7 @@ def saslprep(string):
# Validate the string is a Unicode string
# (text_type is the string type if PY3 and unicode otherwise):
if not is_unicode_str(string):
raise TypeError('input must be of type %s, not %s' % (text_type, type(string)))
raise TypeError('input must be of type %s, not %s' % (str, type(string)))

# RFC4013: 2.1. Mapping.
string = mapping_profile(string)
Expand Down