when running yml file, commands containing backslash return syntax error
Is there a way of running commands using backslash?
e.g.
- name:
hosts:
tasks:
- postgresql_query:
...
path_to_script: db.sql
db.sql
...
\c db
when running yml file, commands containing backslash return syntax error
Is there a way of running commands using backslash?
e.g.
- name:
hosts:
tasks:
- postgresql_query:
...
path_to_script: db.sql
db.sql
...
\c db
According the documentation of postgresql_query there is a parameter db
- name: Run pgsql queries from script
postgresql_query:
db: <Name of database to connect to and run queries against>
path_to_script: <path to a SQL script on the target machine>
with which you connect to a database and then run queries from a SQL script.
According your problem description it seems that you try to connect to a database from within a SQL script.