postgresql permission denied to foreign table pg_redis_fdw

Viewed 6429

I am working with pg_rdeis_fdw from postgres.

When I try to insert a record to the existing schema from the postgres account, it all works fine.

However, when I try to do the same from another user, I get "permission denied for relation", though i gave the user the following privileges:

grant all on FOREIGN DATA WRAPPER redis_fdw to ami;
grant all on FOREIGN SERVER redis_server to ami;
grant all on ALL TABLES IN SCHEMA public to ami;
GRANT ALL PRIVILEGES ON TABLE user_redis_hash to ami;

The definition is as following (and as I was saying, works just fine from user postgres):

CREATE EXTENSION redis_fdw;

CREATE SERVER redis_server
   FOREIGN DATA WRAPPER redis_fdw
   OPTIONS (address '127.0.0.1', port '6379');   

CREATE USER MAPPING FOR PUBLIC
            SERVER redis_server
            OPTIONS (password 'secret');

create foreign table user_redis_hash(key text, val text[])
   server redis_server
   options (database '0', tabletype 'hash', tablekeyset 'user:');   

thanks, Ami

1 Answers
Related