Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #217

Re: postgres 9.0 - NOT IN over 2 databases

From Mladen Gogala <gogala.mladen@gmail.com>
Newsgroups comp.databases.postgresql
Subject Re: postgres 9.0 - NOT IN over 2 databases
Date 2011-08-28 16:08 +0000
Organization solani.org
Message-ID <pan.2011.08.28.16.08.34@gmail.com> (permalink)
References <4e596484$0$315$14726298@news.sunsite.dk>

Show all headers | View raw


On Sat, 27 Aug 2011 23:41:31 +0200, Bjarne Jensen wrote:

> I get a "new" database every 4 weeks. They all have the same schema.
> 
> I need to find out what changes were done to certain tables from one
> issue to the next.
> 
> Presently I COPY a table from OLD_db to file and then import it in the
> NEW_db where I can compare the tables - like this:
> 
> SELECT a,i FROM db_OLD_t WHERE i NOT IN (SELECT i FROM db_NEW_t);
> 
> Now, is there some way I can create a (as in 'one') query that can span
> 2 databases?
> 
> 
> /Bjarne

The dblink extension will help you with that. Essentially, you create 
another connection and retrieve the query results. Here is the 
documentation:
http://www.postgresql.org/docs/current/static/dblink.html

If you don't want that, there is always replication like Slony, which is 
simple to set up and works very reliably, at least in my experience. 
There is nothing like "select * from emp@dblink" in Postgres.



-- 
http://mgogala.byethost5.com

Back to comp.databases.postgresql | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

postgres 9.0 - NOT IN over 2 databases Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-27 23:41 +0200
  Re: postgres 9.0 - NOT IN over 2 databases Mladen Gogala <gogala.mladen@gmail.com> - 2011-08-28 16:08 +0000
    Re: postgres 9.0 - NOT IN over 2 databases Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-29 08:48 +0200

csiph-web