Extension dblink

suggest change

The dblink extension connects to another database and runs a query there. To use it:

  1. Create the extension:
CREATE EXTENSION dblink;
  1. Run the remote query.

For example, select columns from a table in another database. The AS list must name every output column and its type:

SELECT * FROM 
dblink ('dbname = bd_distance port = 5432 host = 10.6.6.6 user = username 
password = passw@rd', 'SELECT id, code FROM schema.table') 
AS newTable(id INTEGER, code character varying);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents