PGsql : Grant every single right to a user on a schema

Lucas Kauffman picture Lucas Kauffman · Jul 23, 2011 · Viewed 17.7k times · Source

I can't figure out how to give every single right to a specific user, I want a user to have every single right on a schema:

  • inserts, deletes, updates, selects, ... on existing tables

I have tried doing :

    GRANT ALL PRIVILEGES ON SCHEMA schema to "user";
    GRANT ALL ON SCHEMA schema to "local_518561";
    GRANT ALL PRIVILEGES ON table schema.table to "user";
    GRANT ALL ON table schema.table to "user";

The querys return succesfull, but every time I use the other user I get insuffiecent permissions error.

Answer

Clint Pachl picture Clint Pachl · Jan 25, 2013
GRANT ALL PRIVILEGES ON                  SCHEMA schema_name TO role_name;
GRANT ALL PRIVILEGES ON ALL TABLES    IN SCHEMA schema_name TO role_name;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO role_name;