You got some good answers already, but one thing to note is that a Postgres connection is always to a single database. So you can query across multiple schemas from the same connection, but not multiple databases.
[1]: https://www.postgresql.org/docs/current/sql-createdatabase.h...
(A few lost internet points from the downvotes are well worth it for that gem of knowledge.)