dblink is a module that supports connections to other PostgreSQL databases from within a database session.
dblink
See also postgres_fdw, which provides roughly the same functionality using a more modern and standards-compliant infrastructure.