People coming from SQL Server and MySQL often complain about how you can't query other databases
from within a PostgreSQL database. In Microsoft SQL Server, there is a concept of querying across databases
on the same server
with dbname.dbo.sometable and querying across servers (even of different types e.g. Oracle) by setting up a linked server and doing
something such as servername.dbname.dbo.sometable or using the OPENROWSET(..) or OPENQUERY(...) syntax.
MySQL has a similar feature by using syntax dbname.sometable, but MySQL lacks schemas so there is no way to segregate a
database into nice buckets as you can with SQL Server and PostgreSQL.
In this article we shall provide some examples of using the contrib module - dblink to query local PostgreSQL databases and remote PostgreSQL databases.
DbLink is probably most comparable in structure to SQL Server's OpenRowset functionality.
It lacks the power of SQL Server's Linked Server
approach or OPENQUERY that allows for synchronized joins between linked servers/databases and local tables and updates/inserts on linked servers. This makes it not terribly useful
in cases where you need to join lots of data with local data. It does however come in handy for bulk copy operations from one database/server to another.