Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WvFzr-000617-9X for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Jun 2014 01:09:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WvFzq-0002ot-QL for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Jun 2014 01:09:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WvFzp-0002ol-Re for pgsql-bugs@postgresql.org; Fri, 13 Jun 2014 01:09:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WvFzm-0002uv-Dk for pgsql-bugs@postgresql.org; Fri, 13 Jun 2014 01:09:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s5D19SUZ030171; Thu, 12 Jun 2014 21:09:28 -0400 From: Tom Lane To: "Burgess, Freddie" cc: "pgsql-bugs@postgresql.org" Subject: Re: pg_restore PostgreSQL 9.3.3 problems In-reply-to: <3BBE635F64E28D4C899377A61DAA9FE02E2F1B17@NBSVR-MAIL01.radiantblue.local> References: <3BBE635F64E28D4C899377A61DAA9FE02E2F1B17@NBSVR-MAIL01.radiantblue.local> Comments: In-reply-to "Burgess, Freddie" message dated "Thu, 12 Jun 2014 20:25:20 -0000" Date: Thu, 12 Jun 2014 21:09:28 -0400 Message-ID: <30170.1402621768@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "Burgess, Freddie" 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