Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a0qEd-0006WC-S6 for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Nov 2015 12:28:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a0qEd-0000sV-Au for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Nov 2015 12:28:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a0qDz-0000BJ-GR for pgsql-bugs@postgresql.org; Mon, 23 Nov 2015 12:28:03 +0000 Received: from mbob.nabble.com ([162.253.133.15]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a0qDw-0006tZ-8H for pgsql-bugs@postgresql.org; Mon, 23 Nov 2015 12:28:02 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 14FD31AB3ACC for ; Mon, 23 Nov 2015 04:15:02 -0800 (PST) Date: Mon, 23 Nov 2015 05:27:58 -0700 (MST) From: pinker To: pgsql-bugs@postgresql.org Message-ID: <1448281678687-5874794.post@n5.nabble.com> Subject: pg_dump - wrong order with inheritance MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_33041_306912572.1448281678698" X-Pg-Spam-Score: -1.9 (-) 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 ------=_Part_33041_306912572.1448281678698 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit *PostgreSQL version*: "PostgreSQL 9.4.4 on i686-pc-linux-gnu, compiled by gcc (Debian 4.4.5-8) 4.4.5, 32-bit"*Operating system*: Debian GNU/Linux 6.0*pg_dump*: pg_dump (PostgreSQL) 9.4.4*command*: /opt/postgresql-9.4.4/bin/pg_dump -U myuser -p 5433 $DBNAME | /opt/postgresql-9.4.4/bin/psql -p 5433 -U myuser ${DBNAME}_${branch}pg_dump doesn't dump data in correct order, so I'm not able to properly restore data. I've used command above and got following errors: 136257:2015-11-23 10:46:55 CET [3107]: [5150-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: null value in column "category_xxx" violates not-null constraint136337:2015-11-23 10:46:55 CET [3107]: [5169-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: null value in column "xxx_id" violates not-null constraint139900:2015-11-23 10:46:59 CET [3107]: [6932-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxx01" violates foreign key constraint "..."139975:2015-11-23 10:46:59 CET [3107]: [6982-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxxx09" violates foreign key constraint "..."140026:2015-11-23 10:46:59 CET [3107]: [7016-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxxx22" violates foreign key constraint "..."140041:2015-11-23 10:46:59 CET [3107]: [7026-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxxx11" violates foreign key constraint "ooo"140046:2015-11-23 10:46:59 CET [3107]: [7030-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: constraint "ooo" for table "xxx22" does not exist140056:2015-11-23 10:46:59 CET [3107]: [7037-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxx44" violates foreign key constraint "..."140086:2015-11-23 10:46:59 CET [3107]: [7057-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxx12" violates foreign key constraint "..."140119:2015-11-23 10:46:59 CET [3107]: [7079-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR: insert or update on table "xxx27" violates foreign key constraint "..." Some tables are inherited. Maybe it's the issue with right order by inheritance?Maybe I can somehow force another order? -- View this message in context: http://postgresql.nabble.com/pg-dump-wrong-order-with-inheritance-tp5874794.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. ------=_Part_33041_306912572.1448281678698 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit PostgreSQL version: "PostgreSQL 9.4.4 on i686-pc-linux-gnu, compiled by gcc (Debian 4.4.5-8) 4.4.5, 32-bit" Operating system: Debian GNU/Linux 6.0 pg_dump: pg_dump (PostgreSQL) 9.4.4 command: /opt/postgresql-9.4.4/bin/pg_dump -U myuser -p 5433 $DBNAME | /opt/postgresql-9.4.4/bin/psql -p 5433 -U myuser ${DBNAME}_${branch} pg_dump doesn't dump data in correct order, so I'm not able to properly restore data. I've used command above and got following errors:
136257:2015-11-23 10:46:55 CET [3107]: [5150-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  null value in column "category_xxx" violates not-null constraint
136337:2015-11-23 10:46:55 CET [3107]: [5169-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  null value in column "xxx_id" violates not-null constraint
139900:2015-11-23 10:46:59 CET [3107]: [6932-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxx01" violates foreign key constraint "..."
139975:2015-11-23 10:46:59 CET [3107]: [6982-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxxx09" violates foreign key constraint "..."
140026:2015-11-23 10:46:59 CET [3107]: [7016-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxxx22" violates foreign key constraint "..."
140041:2015-11-23 10:46:59 CET [3107]: [7026-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxxx11" violates foreign key constraint "ooo"
140046:2015-11-23 10:46:59 CET [3107]: [7030-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  constraint "ooo" for table "xxx22" does not exist
140056:2015-11-23 10:46:59 CET [3107]: [7037-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxx44" violates foreign key constraint "..."
140086:2015-11-23 10:46:59 CET [3107]: [7057-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxx12" violates foreign key constraint "..."
140119:2015-11-23 10:46:59 CET [3107]: [7079-1] user=myuser,db=copied_db,app=psql,client=[local] ERROR:  insert or update on table "xxx27" violates foreign key constraint "..."

Some tables are inherited. Maybe it's the issue with right order by inheritance? Maybe I can somehow force another order?

View this message in context: pg_dump - wrong order with inheritance
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
------=_Part_33041_306912572.1448281678698--