Skip to content

Fix postgres execution not respecting configuration values - #69973

Open
nicholas-rees wants to merge 1 commit into
saltstack:3008.xfrom
nicholas-rees:NRees/postgres-config
Open

Fix postgres execution not respecting configuration values#69973
nicholas-rees wants to merge 1 commit into
saltstack:3008.xfrom
nicholas-rees:NRees/postgres-config

Conversation

@nicholas-rees

@nicholas-rees nicholas-rees commented Aug 8, 2026

Copy link
Copy Markdown

What does this PR do?

Modifies the postgres execution module to respect the configuration set by changing all calls from config.option to config.get and setting the string delimiters to colons.

As noted in the related issue I opened:

# salt-call config.option

Passed invalid arguments: option() missing 1 required positional argument: 'value'.

Usage:

Returns the setting for the specified config value. The priority for
matches is the same as in :py:func:`config.get <salt.modules.config.get>`,
only this function does not recurse into nested data structures. Another
difference between this function and :py:func:`config.get
<salt.modules.config.get>` is that it comes with a set of "sane defaults".
To view these, you can run the following command:

It seems like config.option is just the wrong function to use and config.get is the correct one.

Before this fix:

# salt-call postgres.psql_query "SELECT current_user, session_user;"
local:
    |_
      ----------
      current_user:
          postgres
      session_user:
          postgres

After:

# salt-call postgres.psql_query "SELECT current_user, session_user;"
local:
    |_
      ----------
      current_user:
          salt_admin
      session_user:
          salt_admin

I do not know if this should go in the 3006.x. I sort of suspect that it should but I have not tested this at all on 3006.x so I have made this PR. If you would like to change it to 3006.x let me know and I can do that work.

What issues does this PR fix or reference?

Fixes #69971

Previous Behavior

postgres module was not respecting the configuration set in either the pillars or minion configuration file.

New Behavior

postgres module now respects configuration values.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@nicholas-rees
nicholas-rees requested a review from a team as a code owner August 8, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant