pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to copy table to another database?
3+ messages / 3 participants
[nested] [flat]

* how to copy table to another database?
@ 2003-07-18 20:47 Yudie <yudie@axiontech.com>
  2003-07-18 20:58 ` Re: how to copy table to another database? scott.marlowe <scott.marlowe@ihs.com>
  2003-07-18 21:06 ` Re: how to copy table to another database? Dmitry Tkach <dmitry@openratings.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Yudie @ 2003-07-18 20:47 UTC (permalink / raw)
  To: pgsql-sql

Hi,
Anyone know how the procedure or commands to copy table to another database.
or querying from another database if possible?

thank you

yudie

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

* Re: how to copy table to another database?
  2003-07-18 20:47 how to copy table to another database? Yudie <yudie@axiontech.com>
@ 2003-07-18 20:58 ` scott.marlowe <scott.marlowe@ihs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: scott.marlowe @ 2003-07-18 20:58 UTC (permalink / raw)
  To: Yudie <yudie@axiontech.com>; +Cc: pgsql-sql

On Fri, 18 Jul 2003, Yudie wrote:

> Hi,
> Anyone know how the procedure or commands to copy table to another database.
> or querying from another database if possible?

If you want to copy a table from one db to another, you can use this:

pg_dump dbname -t tablename |psql dbname -e

If you want cross database queries, look in the /contrib/dblink dir in the 
tarball of postgresql




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

* Re: how to copy table to another database?
  2003-07-18 20:47 how to copy table to another database? Yudie <yudie@axiontech.com>
@ 2003-07-18 21:06 ` Dmitry Tkach <dmitry@openratings.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Dmitry Tkach @ 2003-07-18 21:06 UTC (permalink / raw)
  To: Yudie <yudie@axiontech.com>; +Cc: pgsql-sql

Yudie wrote:

> Hi,
> Anyone know how the procedure or commands to copy table to another 
> database.
> or querying from another database if possible?
>
> thank you
>
> yudie

Something like this, perhaps?

psql -d first_database -c '\copy mytable to stdout'  | psql -d 
second_database -c '\copy mytable from stdin'

I hope, it helps...

Dima




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


end of thread, other threads:[~2003-07-18 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 20:47 how to copy table to another database? Yudie <yudie@axiontech.com>
2003-07-18 20:58 ` scott.marlowe <scott.marlowe@ihs.com>
2003-07-18 21:06 ` Dmitry Tkach <dmitry@openratings.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