pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: darcy@druid.net
To: guard <guard@ficnet.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Distributed database ?
Date: Fri, 19 Jan 2001 09:01:33 -0500 (EST)
Message-ID: <m14Jc6f-000AYOC@druid.net> (raw)
In-Reply-To: <946vs7$1k0v$1@news.tht.net>

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 in database_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.



view thread (3+ messages)  latest in thread

Message-ID: <m14Jc6f-000AYOC@druid.net>
Permalink:  ../m14Jc6f-000AYOC@druid.net/
Also on:    postgresql.org/message-id/m14Jc6f-000AYOC@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, guard@ficnet.net
  Subject: Re: Distributed database ?
  In-Reply-To: <m14Jc6f-000AYOC@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox