Re: PG 9 adminstrations - Mailing list pgsql-performance

From Derrick Rice
Subject Re: PG 9 adminstrations
Date
Msg-id CANvs22EqZABNVKwi-YD-eiBjrC9dwXB5CrkcbEcZFPB+Pqb5uw@mail.gmail.com
Whole thread Raw
In response to PG 9 adminstrations  (Hany ABOU-GHOURY <hghoury@gmail.com>)
Responses Re: PG 9 adminstrations  (Hany ABOU-GHOURY <hghoury@gmail.com>)
List pgsql-performance
You don't need "-t history" on the psql part.  It doesn't do what you think it does, and it's reading the next part ("history") as the database name.

try:

pg_dump -h <hostname1> -U postgres -t history DATABASENAME | psql -h hostname2 -U postgres DATABASENAME > db.sql

Derrick

On Tue, Sep 20, 2011 at 11:57 PM, Hany ABOU-GHOURY <hghoury@gmail.com> wrote:
Hi all,

I am trying to update / refresh one table (history) only from prod. database to my test environment database
my query as follows:

pg_dump -h <hostname1> -U postgres -t history DATABASENAME | psql -h hostname2 -U postgres -t history DATABASENAME > db.sql

but I am getting the following error

psql: FATAL:  database "history" does not exist


Can you help please?

what would be the script if I want more than one table (3 tables to refresh)

Kind regards

pgsql-performance by date:

Previous
From: Hany ABOU-GHOURY
Date:
Subject: PG 9 adminstrations
Next
From: Hany ABOU-GHOURY
Date:
Subject: Re: PG 9 adminstrations