# Syntax Error with postgresql\_query module

**URL:** <https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264>\
**Category:** Ansible Project\
**Created:** [May 3, 2019, 7:52pm UTC](https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264 "2019-05-03T19:52:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnani95](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@magnani95](https://forum.ansible.com/u/magnani95)\
**Post date:** [May 3, 2019, 7:52pm UTC](https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264/1 "2019-05-03T19:52:58Z")

</div>

Hi, I have to create and populate a DB with Ansible.

I successfully create the db, but when I add the postgresql\_query I got syntax error.  
I also tried to add the code from documentation ([here](https://docs.ansible.com/ansible/devel/modules/postgresql_query_module.html)) but it get the same.

The **error** is:

> The offending line appears to be:
> 
> - name: Run queries from SQL script  
> ^ here

I put here the playbook, I really have any idea what it could be. Is it a bug?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [May 3, 2019, 8:04pm UTC](https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264/2 "2019-05-03T20:04:13Z")

</div>

can you run it with -vvv ?

---

<div class="post-metadata">

**Author:** ![magnani95](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@magnani95](https://forum.ansible.com/u/magnani95)\
**Post date:** [May 4, 2019, 9:16am UTC](https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264/3 "2019-05-04T09:16:42Z")

</div>

The output is:

---

<div class="post-metadata">

**Author:** ![magnani95](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@magnani95](https://forum.ansible.com/u/magnani95)\
**Post date:** [May 4, 2019, 9:31am UTC](https://forum.ansible.com/t/syntax-error-with-postgresql-query-module/30264/4 "2019-05-04T09:31:37Z")

</div>

**SOLUTION FOUND**  
Sorry I’m very stupid and I shouldn’t work at night.

The problem is that postgresql\_query is new in version 2.8 in development, and I have 2.7.10  
Thank you for your time
