Re: Comparing two tables of different database - Mailing list pgsql-sql

From Lucas Brito
Subject Re: Comparing two tables of different database
Date
Msg-id cccdaefb0905020801i68426f57ycd892021bf27bd8b@mail.gmail.com
Whole thread Raw
In response to Re: Comparing two tables of different database  (Nicholas I <nicholas.domnic.i@gmail.com>)
List pgsql-sql
Nicholas,<br /><br />To use the dblink:<br /><ol><li>In your postgres server you should find a file <b>dblink.sql</b>.
<br/> In my beta installation is in <b>share/postgresql/contrib</b>. It is the installation for the dblink contrib
modulethat usually is already compiled in. It will create a lot of dblink functions.<br /><br /><li>on database2 create
afunction nammed db_datbase1() which returns "dbname=database1" (if you need a login use "dbname=database1
password=xxx",you can also specify host= port= to connect in a remote postgresql database)<br /><br /><li>now execute
thesql:<br /><span style="color: rgb(0, 0, 153);">select * from dblink(db_database1(), 'select "id", "name", "time"
frompr_1') as pr_1("id" integer, "name" text, "time" time)<font color="#000000"><br /> then you will see the table
"pr_1"on the datbase2</font> </span></ol>-- <br />Lucas Brito  

pgsql-sql by date:

Previous
From: "M.P.Dankoor"
Date:
Subject: Re: Comparing two tables of different database
Next
From: johnf
Date:
Subject: using a list to query