pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
duplicate table in two databases
2+ messages / 2 participants
[nested] [flat]

* duplicate table in two databases
@ 2004-08-12 13:42 Fabio Ferrero <nutella@inwind.it>
  2004-08-16 08:01 ` Re: duplicate table in two databases Richard Huxton <dev@archonet.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Fabio Ferrero @ 2004-08-12 13:42 UTC (permalink / raw)
  To: pgsql-sql

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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: duplicate table in two databases
  2004-08-12 13:42 duplicate table in two databases Fabio Ferrero <nutella@inwind.it>
@ 2004-08-16 08:01 ` Richard Huxton <dev@archonet.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2004-08-16 08:01 UTC (permalink / raw)
  To: Fabio Ferrero <nutella@inwind.it>; +Cc: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-08-16 08:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-12 13:42 duplicate table in two databases Fabio Ferrero <nutella@inwind.it>
2004-08-16 08:01 ` Richard Huxton <dev@archonet.com>

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