Managing postgres functions/tirggers with ansible

Hi,

I'm trying to manage a postgres database with ansible.
Database OK, users OK, tables OK.
But now I have a table which has a field that should auto update with
NOW() upon changes. So far that requires SQL statements like this:

CREATE FUNCTION ...
CREATE TRIGGER...

I looked at https://docs.ansible.com/ansible/latest/collections/community/postgresql/index.html
but I don;t immediately see something that suits...
Any suggestions?

thx!

Dick

Hello,

I think the postgresql ansible module is for administrating postgresql or enabling the execution of scripts or queries rather then providing a some layer around DDL or DML commands for PostgreSQL.

You should be able to use postgresql_query_module or postgresql_script_module for executing the SQL you have to provide.

BR,
Roland