0

How can I grant privileges of all tables of a certain schema to a certain role in Postgres8.4?

In Postgres9.x, I can just do this:

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA mySchema TO myRole

It seems like Postgres8.4 doesn't support the ALL TABLE keyword. Is there an alternative to achieving the same result?

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
J.Doe
  • 393
  • 2
  • 6
  • 18
  • 2
    possible duplicate of [PostgreSQL 8.4 grant DML privileges on all tables to a role](http://stackoverflow.com/questions/11599533/postgresql-8-4-grant-dml-privileges-on-all-tables-to-a-role) – Pedro Casagrande Sep 10 '15 at 21:50

1 Answers1

0

Accordingly to the this response you can use the following syntax:

select 'GRANT ALL ON ' || table_schema || '.' || table_name ||' to my_group;' 
from information_schema.tables 
where 
    table_type = 'BASE TABLE' and 
    table_schema not in ('pg_catalog', 'information_schema');
Community
  • 1
  • 1
Pedro Casagrande
  • 167
  • 2
  • 14