Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXP2Z-0004bJ-Lp for pgsql-admin@arkaria.postgresql.org; Thu, 13 Dec 2018 11:20:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gXP2Y-0002Uo-Ee for pgsql-admin@arkaria.postgresql.org; Thu, 13 Dec 2018 11:20:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXP2X-0002UV-Nl for pgsql-admin@lists.postgresql.org; Thu, 13 Dec 2018 11:20:26 +0000 Received: from mail-oln040092254076.outbound.protection.outlook.com ([40.92.254.76] helo=APC01-PU1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXP2U-0001O2-2P for pgsql-admin@postgresql.org; Thu, 13 Dec 2018 11:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g/XeUqvOjobi55aXDRJCZNaGvxeFK6i4Hsz1OSlFF2s=; b=JzVbHTaV0VX7Yg8+RjTPxrDuC/oixf7hANxwSwqIcc4nWUjD0Tnz1yhfnf1VXpdMOsC5jwlbA6svso38au5bji+FcAHnABLwVg6EhygZ5YR4Ck5lGsx4gYgQgEe3VhXdPo0xNZpl8ChE9h5ws41UyFY0p4oQn2Fhmf/pcB6BaDfRDUDTP/ooq/UDyNDzTSqPViyHSSUrSuRwYiTRbhkQyPMIZetEJTvNpw3IrBj7SMyMzwaJo1PwQBUIK8C1hTPRRYr3GR8AA3KfD75TuA9gSgCSDE/PcUFo4PIuJxqnZLrfD+8Z3dpJbp1CvIr58hUcq6Dv8E6fFEKYS4td7RzaDA== Received: from PU1APC01FT013.eop-APC01.prod.protection.outlook.com (10.152.252.59) by PU1APC01HT045.eop-APC01.prod.protection.outlook.com (10.152.253.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1425.16; Thu, 13 Dec 2018 11:20:18 +0000 Received: from MA1PR0101MB1687.INDPRD01.PROD.OUTLOOK.COM (10.152.252.52) by PU1APC01FT013.mail.protection.outlook.com (10.152.252.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1425.16 via Frontend Transport; Thu, 13 Dec 2018 11:20:18 +0000 Received: from MA1PR0101MB1687.INDPRD01.PROD.OUTLOOK.COM ([fe80::6485:aa94:bdb0:92c3]) by MA1PR0101MB1687.INDPRD01.PROD.OUTLOOK.COM ([fe80::6485:aa94:bdb0:92c3%7]) with mapi id 15.20.1425.016; Thu, 13 Dec 2018 11:20:18 +0000 From: soumitra bhandary To: "pgsql-admin@postgresql.org" Subject: Pg_restore failing due to data inconsistency in dump file Thread-Topic: Pg_restore failing due to data inconsistency in dump file Thread-Index: AQHUktXQOXhuyVrPgku4Bbf/jcxSNA== Date: Thu, 13 Dec 2018 11:20:18 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:B19C83556A2A7151B322AAEC888955F3D4F995C1A5450B9A8C739BE51D54115A;UpperCasedChecksum:DFB823C605A1577C52AAE7FBE168F8FDC22164CD0A3D4FC9F4FC15B59EE92C78;SizeAsReceived:6918;Count:43 x-tmn: [aTqAJj/Uv6nJGmhmdKrmgxQ43Z23YmLm] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;PU1APC01HT045;6:xlHPbS3SX8cyfUn/P9A/FduKBWbtuAnpM/OG/jdO6SjpBQCD01Wat73L3czAGvEYBhMRXxLOBeSZ/a4HtRoX5jdTEkJi11gpJZWfvXw+/AMIwJYeespsOurX2iN4Giz//f2Ejq7+uoOUoTkGmzqHmr3YpXXxYrmr907enjb2HkKXQAHsPiogkA1Ra//Sv+Tt3G3mlfmuwlbSKY1k7fselBtOWq6RWaYSCR96q1sVt2jtgqJ0IMcgpC92De6LFF7OQOpBAfo8r2ASSTLottrRljmTzSP6/m0OwvrnVddPdVG6pImG+Sd+ttVu6n5+GdX0AKxCFeX5qcnoffY7K41tBTU+uenGEUEbKAmFodHnxP50Ve+MEnN5b2uptqGN/xLl3qhNZTVmAEI37nd2TN6w/givxsJP8CBVEtAH5RHsoe9WoRw6Z4yT3RaZDeTlxbh7IOqjVMzmaLqMvaeUMk0zwQ==;5:/+NVv4+SihnynLSoySKaLkRVVl40oR8j19zyuzrj5hQT0omOE4VGyik9Osmb8Jt22NdTV49i8/TxEdPCnFvv8gSddY347OoJqxEE1kTS+3SfqVaIoLLQfKqv/ndNt7uVfd9ds8TArT4QyXbq7sZ1SxDF6FJdEmwRZ0+8Mupymj8=;7:m4Sebgy7ULMDuq6BZ9C3cB+4q6fUod1VvS4q0ZxH5m+0Cqk2dOYWmrdpjNWkiWU0kqibl8ZR7+m+XvX9goderUyuCs6tldTlBediC+DRiSXl6H/SA4ZJo2ubuglJgHN6AFDlTDi2vnOVrFA7TbWEUQ== x-incomingheadercount: 43 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101475)(1601125500)(1701031045);SRVR:PU1APC01HT045; x-ms-traffictypediagnostic: PU1APC01HT045: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(4566010)(82015058);SRVR:PU1APC01HT045;BCL:0;PCL:0;RULEID:;SRVR:PU1APC01HT045; x-microsoft-antispam-message-info: TWKP6KJUaxzsD+6+Cx9NSj9N2eMKHe8jPWie9Y5augkD8HgiG7st20J7nnQ+LdUZ Content-Type: multipart/alternative; boundary="_000_MA1PR0101MB16876D291572530CED5E798DE0A00MA1PR0101MB1687_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: a88dc5fe-e6ac-4178-09b3-08d660ecf66a X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2018 11:20:18.1571 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT045 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MA1PR0101MB16876D291572530CED5E798DE0A00MA1PR0101MB1687_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Team , I have encountered following issue while restoring the Postgres dump using = pg_restore . Please provide any suggestion to the same . 1. This dump was taken using bdr_dump as bdr enabled database and all th= e BDR configuration and extension was excluded . 2. DUMP was taken in a running DB server where BDR was running . 3. Postgres Dump was taken in .dump format . 4. During restoration of the same using pg_restore getting following err= or . Error : pg_restore: [archiver (db)] Error from TOC entry 3061; 2606 17551 FK CONSTR= AINT fk_5hrm2vlf9ql5fu043kqepovbr DBNAME pg_restore: [archiver (db)] could not execute query: ERROR: insert or updat= e on table "user_attribute" violates foreign key constraint "fk_5hrm2vlf9ql= 5fu043kqepovbr" DETAIL: Key (user_id)=3D(1f34ec07-7087-45ff-8a56-f36177752499) is not prese= nt in table "user_entity". Command was: ALTER TABLE ONLY user_attribute ADD CONSTRAINT fk_5hrm2vlf9ql5fu043kqepovbr FOREIGN KEY (user_id) REFERENCE= S user_entity... pg_restore: [archiver (db)] Error from TOC entry 3065; 2606 17601 FK CONSTR= AINT fk_c4fqv34p1mbylloxang7b1q3l DBNAME pg_restore: [archiver (db)] could not execute query: ERROR: insert or updat= e on table "user_role_mapping" violates foreign key constraint "fk_c4fqv34p= 1mbylloxang7b1q3l" DETAIL: Key (user_id)=3D(24d1ee2a-b05e-4c30-a292-84045c47611e) is not prese= nt in table "user_entity". Thanks , Soumitra --_000_MA1PR0101MB16876D291572530CED5E798DE0A00MA1PR0101MB1687_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello Team , 

I have encountered following issue while restoring the Postgres dump using = pg_restore . Please provide any suggestion to the same .
  1. This dump was taken using bdr_dump as bdr enabled d= atabase and all the BDR configuration and extension was excluded .
  2. DUMP was taken in a running DB server where BDR was= running .
  3. Postgres Dump was taken in .dump format .
  4. During restoration of the same using pg_restore get= ting following error . 
Error :&nbs= p;

pg_restore: [archiver (db)] Error from TOC entry 3061; 2606 17551 FK CONSTRAINT fk_5hrm2vlf9ql5fu043k= qepovbr DBNAME
pg_restore: [archiver (db)] could not execute query: ERROR: insert or update on table "user_attr= ibute" violates foreign key constraint "fk_5hrm2vlf9ql5fu043kqepo= vbr"
DETAIL: Key (user_id)=3D(1f34ec07-7087-45ff-8a56-f36177752499) is not = present in table "user_entity".
Command was: ALTER TABLE ONLY user_attribute
ADD CONSTRAINT fk_5hrm2vlf9ql5fu043kqepovbr FOREIGN KEY (user_id) REFERENCE= S user_entity...
pg_restore: [archiver (db)] Error from TOC entry 3065; 2606 17601 FK CONSTRAINT fk_c4fqv34p1mbylloxan= g7b1q3l DBNAME
pg_restore: [archiver (db)] could not execute query: ERROR: insert or update on table "user_role= _mapping" violates foreign key constraint "fk_c4fqv34p1mbylloxang= 7b1q3l"
DETAIL: Key (user_id)=3D(24d1ee2a-b05e-4c30-a292-84045c47611e) is not = present in table "user_entity".


Thanks , 

Soumitra 


--_000_MA1PR0101MB16876D291572530CED5E798DE0A00MA1PR0101MB1687_--