pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PG 9 adminstrations
7+ messages / 4 participants
[nested] [flat]

* PG 9 adminstrations
@ 2011-09-21 03:57 Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Hany ABOU-GHOURY @ 2011-09-21 03:57 UTC (permalink / raw)
  To: pgsql-performance

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

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

* Re: PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
@ 2011-09-21 04:16 ` Derrick Rice <derrick.rice@gmail.com>
  2011-09-21 04:29   ` Re: PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Derrick Rice @ 2011-09-21 04:16 UTC (permalink / raw)
  To: Hany ABOU-GHOURY <hghoury@gmail.com>; +Cc: 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
>

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

* Re: PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
@ 2011-09-21 04:29   ` Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 12:48     ` Re: PG 9 adminstrations Shaun Thomas <sthomas@peak6.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Hany ABOU-GHOURY @ 2011-09-21 04:29 UTC (permalink / raw)
  To: Derrick Rice <derrick.rice@gmail.com>; +Cc: pgsql-performance

Thanks but...did not work different error though

ERROR:  relation "history" already exists
ERROR:  relation "idx_history_pagegroupid" already exists
ERROR:  constraint "cdocumentid" for relation "history" already exists



On Wed, Sep 21, 2011 at 4:16 PM, Derrick Rice <derrick.rice@gmail.com>wrote:

> 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
>>
>
>

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

* Re: PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
  2011-09-21 04:29   ` Re: PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
@ 2011-09-21 12:48     ` Shaun Thomas <sthomas@peak6.com>
  2011-09-23 01:17       ` Fwd: [PERFORM] PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Shaun Thomas @ 2011-09-21 12:48 UTC (permalink / raw)
  To: Hany ABOU-GHOURY <hghoury@gmail.com>; +Cc: Derrick Rice <derrick.rice@gmail.com>; pgsql-performance

On 09/20/2011 11:29 PM, Hany ABOU-GHOURY wrote:

> Thanks but...did not work different error though
>
> ERROR: relation "history" already exists
> ERROR: relation "idx_history_pagegroupid" already exists
> ERROR: constraint "cdocumentid" for relation "history" already exists

Clearly the history table already exists on your second host. This may 
or may not matter, if the table definitions are the same. If the table 
on host2 was empty, it'll be filled with the data from host1. If not, 
you'll need to truncate the table on host2 first. If you don't want the 
complaints about tables or indexes or constraints that already exist, 
use the -a option for data-only dumps.

Also, might I suggest using the pgsql-novice list? They're more likely 
to help with general issues like this.

-- 
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604
312-676-8870
sthomas@peak6.com

______________________________________________

See http://www.peak6.com/email-disclaimer/ for terms and conditions related to this email



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

* Fwd: [PERFORM] PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
  2011-09-21 04:29   ` Re: PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 12:48     ` Re: PG 9 adminstrations Shaun Thomas <sthomas@peak6.com>
@ 2011-09-23 01:17       ` Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-23 01:36         ` Re: Fwd: [PERFORM] PG 9 adminstrations Daniel Staal <DStaal@usa.net>
  0 siblings, 1 reply; 7+ messages in thread

From: Hany ABOU-GHOURY @ 2011-09-23 01:17 UTC (permalink / raw)
  To: pgsql-novice@postgresql.org

Please help with below issue I am new to postgresql

Many thanks for taking the time to read my email

Cheers
Hany

---------- Forwarded message ----------
From: Shaun Thomas <sthomas@peak6.com>
Date: Thu, Sep 22, 2011 at 12:48 AM
Subject: Re: [PERFORM] PG 9 adminstrations
To: Hany ABOU-GHOURY <hghoury@gmail.com>
Cc: Derrick Rice <derrick.rice@gmail.com>, pgsql-performance@postgresql.org


On 09/20/2011 11:29 PM, Hany ABOU-GHOURY wrote:

 Thanks but...did not work different error though
>
> ERROR: relation "history" already exists
> ERROR: relation "idx_history_pagegroupid" already exists
> ERROR: constraint "cdocumentid" for relation "history" already exists
>

Clearly the history table already exists on your second host. This may or
may not matter, if the table definitions are the same. If the table on host2
was empty, it'll be filled with the data from host1. If not, you'll need to
truncate the table on host2 first. If you don't want the complaints about
tables or indexes or constraints that already exist, use the -a option for
data-only dumps.

Also, might I suggest using the pgsql-novice list? They're more likely to
help with general issues like this.

-- 
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604
312-676-8870
sthomas@peak6.com

______________________________**________________

See http://www.peak6.com/email-**disclaimer/<http://www.peak6.com/email-disclaimer/>for
terms and conditions related to this email

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

* Re: Fwd: [PERFORM] PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
  2011-09-21 04:29   ` Re: PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 12:48     ` Re: PG 9 adminstrations Shaun Thomas <sthomas@peak6.com>
  2011-09-23 01:17       ` Fwd: [PERFORM] PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
@ 2011-09-23 01:36         ` Daniel Staal <DStaal@usa.net>
  2011-09-23 03:43           ` Re: Fwd: [PERFORM] PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Daniel Staal @ 2011-09-23 01:36 UTC (permalink / raw)
  To: Hany ABOU-GHOURY <hghoury@gmail.com>; pgsql-novice@postgresql.org

--As of September 23, 2011 1:17:37 PM +1200, Hany ABOU-GHOURY is alleged to 
have said:

> Please help with below issue I am new to postgresql
>
>
> Many thanks for taking the time to read my email

--As for the rest, it is mine.

I'm sure we'd be glad to help, but I think we're going to need you to start 
at the beginning.  What's the problem you are having?  What are you trying 
to do?

You sent an output of an error, saying that it was a 'different error'. 
What did you try?  What were you trying originally?  This is a different 
group than you were sending to before, so we don't have the history.

We'll help as soon as we can.  But we have to know what the problem is.  ;)

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------



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

* Re: Fwd: [PERFORM] PG 9 adminstrations
  2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 04:16 ` Re: PG 9 adminstrations Derrick Rice <derrick.rice@gmail.com>
  2011-09-21 04:29   ` Re: PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-21 12:48     ` Re: PG 9 adminstrations Shaun Thomas <sthomas@peak6.com>
  2011-09-23 01:17       ` Fwd: [PERFORM] PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
  2011-09-23 01:36         ` Re: Fwd: [PERFORM] PG 9 adminstrations Daniel Staal <DStaal@usa.net>
@ 2011-09-23 03:43           ` Hany ABOU-GHOURY <hghoury@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Hany ABOU-GHOURY @ 2011-09-23 03:43 UTC (permalink / raw)
  To: PGSQL-Novice <pgsql-novice@postgresql.org>

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

pg_dump -h host1 -U postgres -t history DB1 | psql -h host2 -U postgres -t
history DB2 > 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

On Fri, Sep 23, 2011 at 1:36 PM, Daniel Staal <DStaal@usa.net> wrote:

> --As of September 23, 2011 1:17:37 PM +1200, Hany ABOU-GHOURY is alleged to
> have said:
>
>  Please help with below issue I am new to postgresql
>>
>>
>> Many thanks for taking the time to read my email
>>
>
> --As for the rest, it is mine.
>
> I'm sure we'd be glad to help, but I think we're going to need you to start
> at the beginning.  What's the problem you are having?  What are you trying
> to do?
>
> You sent an output of an error, saying that it was a 'different error'.
> What did you try?  What were you trying originally?  This is a different
> group than you were sending to before, so we don't have the history.
>
> We'll help as soon as we can.  But we have to know what the problem is.  ;)
>
> Daniel T. Staal
>
> ------------------------------**------------------------------**---
> This email copyright the author.  Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes.  This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ------------------------------**------------------------------**---
>

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


end of thread, other threads:[~2011-09-23 03:43 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 03:57 PG 9 adminstrations Hany ABOU-GHOURY <hghoury@gmail.com>
2011-09-21 04:16 ` Derrick Rice <derrick.rice@gmail.com>
2011-09-21 04:29   ` Hany ABOU-GHOURY <hghoury@gmail.com>
2011-09-21 12:48     ` Shaun Thomas <sthomas@peak6.com>
2011-09-23 01:17       ` Hany ABOU-GHOURY <hghoury@gmail.com>
2011-09-23 01:36         ` Daniel Staal <DStaal@usa.net>
2011-09-23 03:43           ` Hany ABOU-GHOURY <hghoury@gmail.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