Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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;
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.