Unix Technical Forum

Problme in my pg_dump command

This is a discussion on Problme in my pg_dump command within the pgsql Novice forums, part of the PostgreSQL category; --> Hi Good morning. I have taken a backup of the databse from the windows commandline with the following command: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:10 PM
Sree Narayana
 
Posts: n/a
Default Problme in my pg_dump command

Hi

Good morning.

I have taken a backup of the databse from the windows commandline with the
following command:

C:\[pg_dump loaction]\pg_dump.exe -h localhost -p 5432 -U postgres -F c -v
-f C:\db_backup.backup myDB;

This worked fine.

However I am facing the problem while restoring. I am trying with the
following command from the windows command line:

C:\[pg_restore location]\pg_restore.exe -i -h localhost -p 5432 -U postgres
-d myDB -v C:\db_backup.backup

If I give "-c", its working fine. However I don't want to drop the database
while restoring.
So is it possible to restore database without dropping database?


without "-c" I am getting the following error messages, and no data is
restored in database:

pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 448; 2612 16386 PROCEDURAL
LANGUAGE
plpgsql
pg_restore: [archiver (db)] could not execute query: ERROR: language
"plpgsql" alrea
dy exists
Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
pg_restore: creating TABLE agentdefvalobject
pg_restore: [archiver (db)] Error from TOC entry 1476; 1259 50028 TABLE
agentdefvalob
ject postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"agentdefvalobj
ect" already exists
Command was: CREATE TABLE agentdefvalobject (
name character varying(100) NOT NULL,
value character varying(100)
);
pg_restore: creating TABLE alert
pg_restore: [archiver (db)] Error from TOC entry 1410; 1259 49738 TABLE
alert postgre
s
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"alert" already
exists
Command was: CREATE TABLE alert (
id integer,
groupname character varying(100),
category character varying(100),
severity...
pg_restore: creating TABLE alertlogger
pg_restore: [archiver (db)] Error from TOC entry 1418; 1259 49792 TABLE
alertlogger p
ostgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"alertlogger" a
lready exists
Command was: CREATE TABLE alertlogger (
valuestring character varying(250)
);
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------

thanks
Sreeman

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 10:11 PM
Tomeh, Husam
 
Posts: n/a
Default Re: Problme in my pg_dump command

If you're trying to restore the data only to an existing database, you
could use the "-a " option to restore data only, rather than the schema
definitions.

--
Husam


________________________________

From: pgsql-novice-owner@postgresql.org
[mailtogsql-novice-owner@postgresql.org] On Behalf Of Sree Narayana
Sent: Tuesday, September 12, 2006 7:29 AM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Problme in my pg_dump command


Hi

Good morning.

I have taken a backup of the databse from the windows commandline with
the following command:

C:\[pg_dump loaction]\pg_dump.exe -h localhost -p 5432 -U postgres -F c
-v -f C:\db_backup.backup myDB;

This worked fine.

However I am facing the problem while restoring. I am trying with the
following command from the windows command line:

C:\[pg_restore location]\pg_restore.exe -i -h localhost -p 5432 -U
postgres -d myDB -v C:\db_backup.backup

If I give "-c", its working fine. However I don't want to drop the
database while restoring.
So is it possible to restore database without dropping database?


without "-c" I am getting the following error messages, and no data is
restored in database:

pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 448; 2612 16386
PROCEDURAL LANGUAGE
plpgsql
pg_restore: [archiver (db)] could not execute query: ERROR: language
"plpgsql" alrea
dy exists
Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
pg_restore: creating TABLE agentdefvalobject
pg_restore: [archiver (db)] Error from TOC entry 1476; 1259 50028 TABLE
agentdefvalob
ject postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"agentdefvalobj
ect" already exists
Command was: CREATE TABLE agentdefvalobject (
name character varying(100) NOT NULL,
value character varying(100)
);
pg_restore: creating TABLE alert
pg_restore: [archiver (db)] Error from TOC entry 1410; 1259 49738 TABLE
alert postgre
s
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"alert" already
exists
Command was: CREATE TABLE alert (
id integer,
groupname character varying(100),
category character varying(100),
severity...
pg_restore: creating TABLE alertlogger
pg_restore: [archiver (db)] Error from TOC entry 1418; 1259 49792 TABLE
alertlogger p
ostgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation
"alertlogger" a
lready exists
Command was: CREATE TABLE alertlogger (
valuestring character varying(250)
);
---------------------------------------------------------
---------------------------------------------------------
---------------------------------------------------------

thanks
Sreeman

************************************************** ********************
This message contains confidential information intended only for the use of the addressee(s) named above and may contain information that is legally privileged. If you are not the addressee, or the person responsible for delivering it to the addressee, you are hereby notified that reading, disseminating, distributing or copying this message is strictly prohibited. If you have received this message by mistake, please immediately notify us by replying to the message and delete the original message immediately thereafter.

Thank you.

FADLD Tag
************************************************** ********************

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com