I am trying to create an FDW using the postgres
super user credentials using the following steps -
- My super user is
postgres
- CREATE SERVER
testfdw
FOREIGN DATA WRAPPERpostgres_fdw
OPTIONS (host '10.10.10.171', dbname 'testdb', port '5432', fetch_size '50000'); - I have created a read only remote user called
testdb_read_only_user
ontestdb
and granted read only privileges to all tables and sequences and functions in there - I now create a user mapping for my local db super user
postgres
- CREATE USER MAPPING
FOR
postgres
SERVERtestfdw
OPTIONS (user 'testdb_read_only_user', password 'testpasswrd') - Then I run IMPORT FOREIGN SCHEMA public FROM SERVER
testfdw
INTOtest_local_schema
; - Now when I try to create a new foreign table into
test_local_schema
using thepostrges
super user, I am still able to create one, but the actual behaviour I expect is a permission denied error and my user mapping is based on the read only user I created on the Remote DB
Am I missing something here. Please guide.