0
I’m trying to connect two postgre databases and I’m getting an error importing the tables:
CREATE EXTENSION postgres_fdw;
CREATE SERVER gestware_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'localhost', dbname 'gwrcsgf1');
CREATE USER MAPPING FOR CURRENT_USER
SERVER gestware_server
OPTIONS (user 'postgres', password 'senha');
CREATE SCHEMA app;
IMPORT FOREIGN SCHEMA public
FROM SERVER gestware_server
INTO app'
I get the message:
'ERROR: syntax error at or near "IMPORT" LINE 1: IMPORT FOREIGN SCHEMA public'
Your IMPORT command seems incomplete. Check your post.
– anonimo
Also check the postgres version. This command is only available from 9.5
– Camilo Santos
That’s what happened. My version is 12.1 but the remote database is in 9.3. I used 'CREATE FOREIGN TABLE'
– p9adi