You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running pg_upgrade, PG will create a file called update_extensions.sql that you're supposed to use to upgrade all the extensions after the upgrade. However, passing this script to postgresql_script fails with the following:
192.168.122.36 failed | msg: Cannot execute SQL '\connect postgres
ALTER EXTENSION "pg_stat_statements" UPDATE;
' None: syntax error at or near "\"
LINE 1: \connect postgres
^
Ran out of hosts!
It doesn't like the \connect which is a psql-ism. I'm not sure if this a bug in the module, or in psycopg2.
reads it with .read(), i.e. the whole content at once
feeds it to the cursor.execute() method w/o any intermediate transformations
Probably yes, the driver just doesn't understand the \connect postgres psql-ism, it's probably supposed to understand only standard queries.
I believe we shouldn't modify the files on the module side.
There's already a warning in the module description but it's only about dump files. I think we could generalize it more saying something like Do not use it with files made by PostgreSQL tools like pg_dump or pg_upgrade....
What do you think?
SUMMARY
When running
pg_upgrade
, PG will create a file calledupdate_extensions.sql
that you're supposed to use to upgrade all the extensions after the upgrade. However, passing this script topostgresql_script
fails with the following:It doesn't like the
\connect
which is a psql-ism. I'm not sure if this a bug in the module, or in psycopg2.ISSUE TYPE
COMPONENT NAME
postgresql_script
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
This was Rocky 9 upgrading PG from 12.x to 13.x
STEPS TO REPRODUCE
see summary
EXPECTED RESULTS
Would like
postgresql_script
to not error if possible.ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: