From: Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
To: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Data Migration
Date: Thu, 2 Dec 1999 09:45:21 -0600
Message-ID: <19991202094521.A11044@wallace.ece.rice.edu> (raw)
In-Reply-To: <m11tHDl-0000cRC@druid.net>
References: <Pine.LNX.4.04.9912011214040.30244-100000@asgard.altoplanos.net>
<m11tHDl-0000cRC@druid.net>
On Wed, Dec 01, 1999 at 04:23:29PM -0500, D'Arcy J.M. Cain wrote:
> Thus spake Roderick A. Anderson
> > On Wed, 1 Dec 1999, Tom Lane wrote:
> > > No; in Postgres, different databases are different universes ... and
> > > there are no wormholes in SQL ;-).
> >
> > Does SQL92 say no wormholes? Is it a major pain to code this? I've got
> > no complaints as I can see ways to do it from the application level.
>
> I don't know what SQL92 says and. like you, I have easy ways to do this
> at the app level but for what it's worth, here's a suggested syntax
> for this in case someone want to implement it.
>
> OPEN DATABASE <dbname> [AS <alias>] [HOST host] [PORT port] [TYPE <db type>]
This syntax seems reasonable, although as Oleg pointed out, you need
various amounts of authentication info. I suppose an inital restriction
(and latter default) for connecting to dbs under the same postmaster, is to
use the same user, since you've already authenticated. Going to a differnent
type of db would require some alternative authentication, however. There
may be db type specific attributes as well.
>
> And use it as
>
> OPEN DATABASE db1 HOST 'other.what.com';
> SELECT * FROM mytab, db1.othertab yourtab
> WHERE mytab.f1 = yourtab.f1;
>
> or
>
> SELECT mytab.f1, db1.yourtab.f2, ...
>
This notation, db.table.field, does seem to be how other DBMSs do
it. I've been wondering, however, if our parser would have any trouble
with it, since in an identifier string token1.token2, token1 is no longer
guaranteed to be a table. Need to look at the code, I suppose.
Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
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-interfaces@postgresql.org
Cc: reedstrm@wallace.ece.rice.edu
Subject: Re: [INTERFACES] Data Migration
In-Reply-To: <19991202094521.A11044@wallace.ece.rice.edu>
* 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