# Grant all privileges on a  database using postgresql\_user module

**URL:** <https://forum.ansible.com/t/grant-all-privileges-on-a-database-using-postgresql-user-module/17202>\
**Category:** Ansible Project\
**Created:** [January 7, 2015, 6:00am UTC](https://forum.ansible.com/t/grant-all-privileges-on-a-database-using-postgresql-user-module/17202 "2015-01-07T06:00:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navid\_Paya](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@Navid\_Paya](https://forum.ansible.com/u/Navid_Paya)\
**Post date:** [January 7, 2015, 6:00am UTC](https://forum.ansible.com/t/grant-all-privileges-on-a-database-using-postgresql-user-module/17202/1 "2015-01-07T06:00:14Z")

</div>

Hi  
I have been struggling with this for half a day but could be my lacking knowledge of PostgreSQL. I have a database and I want to gran full privileges on it to a particular user. This is what the psq query for that looks like:

psql -U postgres -c “GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO random\_user” random\_database

What would be the equivalent to this using the priv directive in that module? I tried “priv=ALL” but that didn’t work and when I try “ALL/ALL:ALL” I get a complaint that relation “ALL” doesn’t exist. Does that mean the only way is to list the tables one by one?

Regards

Navid
