PostgreSQL: Create DBLINK

PHOTO EMBED

Mon Aug 29 2022 14:04:56 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #sql

---Sql:
    
CREATE EXTENSION dblink;

---Then you can use it like this:
    
select * from dblink('dbname=otherdbname','select field1, field2 from otherdb_table') as foreign_table(field1 varchar, field2 integer)
content_copyCOPY

Very useful method to access to data contained into another database on same postgresql server. Current user must have permissions to read foreign database tables.