Re: Distributed database ? - Mailing list pgsql-sql

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: Distributed database ?
Date
Msg-id m14Jc6f-000AYOC@druid.net
Whole thread Raw
In response to Distributed database ?  ("guard" <guard@ficnet.net>)
List pgsql-sql
Thus spake guard
> how to run "select from databaseA:tabl1 ,databaseB:table2 "

You can't.  You have to have two databases open and do it yourself.  I use
Python and often do things like this.

import pg
adb = pg.DB('dbase_a')
bdb = pg.DB('dbase_b')

row = adb.get('table_a', 1)    # second argument references primary key                              # of table_a in
database_a
bdb.get('table_b', row)        # one of the fields in row is the primary                              # key of table_b
indatabase_b
 

This assumes that the field names are consistent between databases otherwise
you have to add an extra assignment in but that's the basic idea.  Similar
ways exist in other interfaces.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-sql by date:

Previous
From: Ramesh H R
Date:
Subject: Where can i get Pgaccess
Next
From: "Oliver Elphick"
Date:
Subject: Re: Where can i get Pgaccess