3

What is wrong with the following statement?

GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO foo;

I get this error

ERROR:  syntax error at or near "ALL"
LINE 2: ON ALL TABLES IN SCHEMA public TO foo;

I am using postgreSQL 8.3 on Ubuntu.

Alex
  • 1,853

2 Answers2

6

Your syntax is correct but only for PostgreSQL 9.0 and newer.
In 8.3 you will have to list all tables by name:

GRANT SELECT, INSERT, UPDATE, DELETE ON tab1, tab2, tab3 TO foo;
Frg
  • 236
1

AFAIK, this is invalid in postgresql DB. You should grant the privileges on all tables by specifying them. The word ALL is invalid here.

Khaled
  • 719