Re: Needs Suggestion

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: SUBHAM ROY <subham(dot)iem(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Needs Suggestion
Date: 2011-04-19 23:42:09
Message-ID: BANLkTin-JCn0-LSQL64OGEA7u24t_qS6gg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 19, 2011 at 5:06 PM, SUBHAM ROY <subham(dot)iem(at)gmail(dot)com> wrote:
> Suppose Postgres is installed in two computers C1 & C2.
> C1 have some database tables. How can I copy these database tables from C1
> to C2.
> I mean to say that can I copy tables from postgres installed in one m/c to
> another m/c.
> Is there any command in postgres to do so or any other short cut technique.

Assuming you don't have to worry about foreign keys etc, you can dump
a table from one db and feed it to a psql session open to another:

pg_dump -h host1 dbname -t tablename | psql -h host2 dbname

and so on.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Geraldo Lopes de Souza 2011-04-19 23:59:27 Re: Are Update rights on the target table of a do instead update rule necessary ?
Previous Message SUBHAM ROY 2011-04-19 23:06:21 Needs Suggestion