简体   繁体   中英

postgres 8.4 - grant privileges

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?

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM