Saturday, August 7, 2010

Postgresql dblink

How to use dblink in Postgres on Windows.

First, get the dblink.sql from here...

C:\Program Files (x86)\PostgreSQL\8.4\share\contrib

...then execute it in pgAdmin.

Sample query:

select * 
   dblink('dbname=test user=postgres password=opensesame',
      'select lname, fname, addressline from customer') 
      as customer(lname text, fname text, addressline text)

No comments:

Post a Comment