In Postgres, you can link to your other databases using dblink
, but the syntax is very verbose. For example you can do:
SELECT *
FROM dblink (
'dbname=name port=1234 host=host user=user password=password',
'select * from table'
) AS users([insert each column name and its type here]);
Is there any way to do this faster? Maybe pre-define the connections?
I noticed that Postgres has a new create foreign table
function for connecting to a MySQL database. It has a simpler syntax than dblink
. Could I use that?
postgres_fdw
and included in standard PostgreSQL. – Scaly