From: Tom Lane <tgl@sss.pgh.pa.us>
To: Burgess, Freddie <FBurgess@Radiantblue.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: pg_restore PostgreSQL 9.3.3 problems
Date: Thu, 12 Jun 2014 21:09:28 -0400
Message-ID: <30170.1402621768@sss.pgh.pa.us> (raw)
In-Reply-To: <3BBE635F64E28D4C899377A61DAA9FE02E2F1B17@NBSVR-MAIL01.radiantblue.local>
References: <3BBE635F64E28D4C899377A61DAA9FE02E2F1B17@NBSVR-MAIL01.radiantblue.local>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"Burgess, Freddie" <FBurgess@Radiantblue.com> writes:
> Successful pg_dump:
> pg_dump -h localhost -p 5432 -U postgres -F c -b -v -f "trackdb.partial.dmp" -t tracker_message -t tracker_event_message_y2010m01 trackdb
> Attempted pg_restore:
> pg_restore -c -F c -j 3 -U postgres -d trackdb -v "trackdb.partial.dmp"
> Error Condition:
> pg_restore: [archiver (db)] Error from TOC entry 575; 1259 618063 TABLE tracker_message postgres
> pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop table tracker_message because other objects depend on it
> DETAIL: constraint tracker_event_message_id_fkey on table tracker_event_message_underflow depends on table tracker_message
> constraint tracker_event_message_id_fkey on table tracker_event_message_y2010m01 depends on table tracker_message.
> the -c option; Clean is suppose to (drop) database objects before
> recreating them, but its not doing it because of referential integrity
> constraints.
pg_restore -c is only able to drop objects that are listed in the dump
file. What seems to be happening here (though you've provided very little
detail) is that there are foreign keys to these tables from other tables
not included in the partial dump --- tracker_event_message_underflow for
example. pg_restore doesn't know about those foreign keys, so it doesn't
drop them, so when it tries to drop the objects it *does* know about,
those commands fail. This is designed behavior for -c --- we don't want
it clobbering stuff it's unable to recreate.
You haven't really explained what results you're hoping to achieve here,
so it's hard to give advice about what to do instead. But I don't think
this is a bug. It may well be that what you want is outside the
capabilities of pg_dump/pg_restore ... but that's a feature request
not a bug fix.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, FBurgess@Radiantblue.com
Subject: Re: pg_restore PostgreSQL 9.3.3 problems
In-Reply-To: <30170.1402621768@sss.pgh.pa.us>
References: <3BBE635F64E28D4C899377A61DAA9FE02E2F1B17@NBSVR-MAIL01.radiantblue.local> <30170.1402621768@sss.pgh.pa.us>
* 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