Обсуждение: connect to another db

Поиск
Список
Период
Сортировка

connect to another db

От
"Robert Wimmer"
Дата:
is there any possibility in plpgsql (or from the psql prompt) to retrive
data from any other PG database. if not is there a (recommended) work around
for this problem.

regards sepp



Re: connect to another db

От
"A. Kretschmer"
Дата:
am  07.12.2005, um  8:18:45 +0000 mailte Robert Wimmer folgendes:
> is there any possibility in plpgsql (or from the psql prompt) to retrive
> data from any other PG database. if not is there a (recommended) work
> around for this problem.

You can use dblink (conntrib) or languages like plpgperl to connect to
multiple db.

http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/


A better way is to use only one DB and using schemas.


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: connect to another db

От
"Robert Wimmer"
Дата:
hi,

a schema wouldnt help. i have to import data from a different PG db.dblink
would be the right choice, but i think i need a NIX OS to install it ? PG
runs on windows in the company I work for...

is the perl solution available on windows ? i think there is no plperl
installed on windows.

Postgres 8.0
Windows XP Professional

regards and thanks fo the prompt response

>From: "A. Kretschmer" <andreas.kretschmer@schollglas.com>
>To: pgsql-novice@postgresql.org
>Subject: Re: [NOVICE] connect to another db
>Date: Wed, 7 Dec 2005 09:51:46 +0100
>
>am  07.12.2005, um  8:18:45 +0000 mailte Robert Wimmer folgendes:
> > is there any possibility in plpgsql (or from the psql prompt) to retrive
> > data from any other PG database. if not is there a (recommended) work
> > around for this problem.
>
>You can use dblink (conntrib) or languages like plpgperl to connect to
>multiple db.
>
>http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/
>
>
>A better way is to use only one DB and using schemas.
>
>
>HTH, Andreas
>--
>Andreas Kretschmer    (Kontakt: siehe Header)
>Heynitz:  035242/47212,      D1: 0160/7141639
>GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
>  ===    Schollglas Unternehmensgruppe    ===
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: explain analyze is your friend



Re: connect to another db

От
Andreas Kretschmer
Дата:
Robert Wimmer <seppwimmer@hotmail.com> schrieb:

> hi,
>
> a schema wouldnt help. i have to import data from a different PG db.dblink
> would be the right choice, but i think i need a NIX OS to install it ? PG
> runs on windows in the company I work for...

How often du you need this import? Is the different PG db on the same
machine?
At work i have also different PG db's on the same machine, and now i
know i need connections between tables on different db's. Now i have a
new server and i transform old db's to the new server to one db, but
different schemas. I think, this is a good solution.


>
> is the perl solution available on windows ? i think there is no plperl
> installed on windows.

I don't know, i hate windows and don't use this. But i think, plperl are
also available under this OS. But i'm not sure.


> >From: "A. Kretschmer" <andreas.kretschmer@schollglas.com>

Please, no silly top-posting.


HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: connect to another db

От
Дата:
> hi,
>
> a schema wouldnt help. i have to import data from a
> different PG db.dblink
> would be the right choice, but i think i need a NIX
> OS to install it ? PG
> runs on windows in the company I work for...

it sounds to me like you have the original data in one
database and that you are manually moving it to
another database at consistent time intervals.

is this right?

if so, consider the following questions:

1. why are two different machines absolutely
necessary?  if they aren't, use one machine.  try to
make sure the reason is technically valid and fight
against political reasons.
2. why are two databases necessary?  if not, use one
db.  if separation of data is technically required,
using different schema may be a solution.
3. if two machines and two dbs are necessary, can the
machines be networked?  if so, you may be able to
write an automation script that dumps from one
database and restores to the other database.

good luck.



__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com