How to grant read access to Foreign Data Wrapper (FDW) in Postgres

280 views Asked by At

We have a database that contains two schemas, "FDW" and "main_schema". The IT department and I are trying to grant read access for me to the "FDW", I already have read access to "main_schema". Neither myself nor the IT department built the database and are uncertain how to grant read access to the "FDW". We have tried the below with error returned "SQL Error [42704]: ERROR: user mapping not found for "username""

-- create read only group
CREATE ROLE readaccess;

-- Grant access to existing tables
GRANT USAGE ON schema fdw TO READACCESS;

GRANT SELECT ON ALL TABLES IN SCHEMA fdw TO READACCESS;

CREATE USER username WITH PASSWORD '123';
GRANT readaccess TO username;

How do I create user mapping so I can gain access to the table with in the FDW schema?

0

There are 0 answers