0

In Exasol it's possible to connect via JDBC/ODBC to a remote database and directly import the result of a statement into a local table.

CREATE OR REPLACE CONNECTION JDBC_POSTGRESQL
    TO 'jdbc:postgresql://host:port/remote_db?user=remote_user'
    IDENTIFIED BY 'my_connection';

INSERT INTO target_local_table
SELECT * FROM
(
  import from JDBC at JDBC_POSTGRESQL
  statement 'select * from source_remote_table'
);

Is there a similar mechanism in PostgreSQL?

Jivan
  • 21,522
  • 15
  • 80
  • 131
  • 1
    Foreign data wrappers: https://www.postgresql.org/docs/current/ddl-foreign-data.html –  Apr 20 '20 at 09:41
  • @a_horse_with_no_name thanks! Which triggers another question... https://stackoverflow.com/questions/61319954/foreign-data-wrapper-postgres-fdw-does-not-exist-even-if-it-does – Jivan Apr 20 '20 at 10:12

0 Answers0