pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Tkach <dmitry@openratings.com>
To: Yudie <yudie@axiontech.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: how to copy table to another database?
Date: Fri, 18 Jul 2003 17:06:54 -0400
Message-ID: <3F18616E.60407@openratings.com> (raw)
In-Reply-To: <003101c34d6d$cb199010$8401a8c0@yudie>
References: <003101c34d6d$cb199010$8401a8c0@yudie>

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




view thread (3+ messages)

Message-ID: <3F18616E.60407@openratings.com>
Permalink:  ../3F18616E.60407@openratings.com/
Also on:    postgresql.org/message-id/3F18616E.60407@openratings.com

 · 

reply

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-sql@postgresql.org
  Cc: dmitry@openratings.com, yudie@axiontech.com
  Subject: Re: how to copy table to another database?
  In-Reply-To: <3F18616E.60407@openratings.com>

* 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