duplicate table in two databases

duplicate table in two databases

am 12.08.2004 15:42:40 von Fabio Ferrero

I use postgres 7.2.1 (debian woody) and PHP.

I've two databases (foo and bar for example) with the same table (ie.
stamps).

It's possible with a single query transfer the data from the stamps
table in db foo to the stamps table in db bar?

Or I need a row by row copy? Or maybe a dump on temp file?

(with one db and two tables with the same record I can use INSERT INTO
foo SELECT * FROM bar).

Thanks.

Re: duplicate table in two databases

am 16.08.2004 10:01:31 von dev

Fabio Ferrero wrote:
> I use postgres 7.2.1 (debian woody) and PHP.
>
> I've two databases (foo and bar for example) with the same table (ie.
> stamps).
>
> It's possible with a single query transfer the data from the stamps
> table in db foo to the stamps table in db bar?

You might want to look in the contrib/ folder of the source distribution
(or the equivalent in your packaged installation for "dblink". Haven't
used it myself, but it can certainly do what you want here.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend