I created it on my Server 1 but I am unable to view it on the Server 2. I can see all tables through fdw after IMPORT FOREIGN SCHEMA.
I was able to get access to my view only after recreating the SERVER / USER MAPPING on Server 2.
Is it the expected behavior to recreate the FOREIGN SERVER / SCHEMA after a new table or view has been created ?
| No, you don't need to re create the foreign server. How did it not work?
After I created the view on the server 1, I tried to import it in the Foreign Schema on Server 2 using the LIMITED clause.
The command executed successfully but when I tried to query the view on server 2, it returned that table did not exist.
So, I tried to reimport the full schema (after dropping / creating the schema on server 2), I ran the IMPORT FOREIGN SCHEMA without any LIMITED clause. I could see all tables but still not the view.
The only solution that I found in order to get the view accessible on Server 2 was to recreate the SERVER / USER MAPPING and IMPORT FOREIGN SCHEMA.