Reputation: 143
I created a foreign data wrapper and created the user mappings for 2 users one is admin and the other only has readonly access to the tables. When I try to query using the readonly user I get an error:
ERROR: permission denied for schema testing LINE 1: SELECT * FROM testing.bldg ^ ********** Error ********** ERROR: permission denied for schema testing SQL state: 42501 Character: 15
Here is my setup: Postgres 9.6.1 in Amazon RDS, both DBs are part of same AWS RDS instance. When I connect to remote database directly using the readonly user I am able to query the table, problem only happens when using the fdw.
As the readonly use when I query this "select * from pg_foreign_table;" I see all the foreign tables.
I have tried the following:
grant usage on schema ...
grant select on table...
GRANT USAGE ON FOREIGN SERVER ...
Any ideas.
Upvotes: 1
Views: 3815
Reputation: 143
I was able to resolve the issue, here are the steps:
Upvotes: 2