Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028684Openbravo ERPY. DBSourceManagerpublic2015-01-20 10:182015-08-10 15:32
shuehner 
alostale 
normalmajorhave not tried
closedfixed 
5
 
3.0PR15Q2 
shuehner
Core
No
0028684: Doing pg_dump+pg_restore + export.database leads to a few check constraint being exported wrongly
Doing this sequence of steps on a postgresl 9.3 or 9.4 server

a.) ant install.source
b.) pg_dump
c.) drop+recreate the db
d.) pg_restore
e.) dbconsistency check / ant install.source

Gets that step e.) to show inconsistencies in some check constraints + also leads that install.source to fail because of those wrongly exported check constraints.

As that sequence of steps is needed for both
1.) 9.1 > 9.3 migration
2.) any backup+restore in 9.3

that is a major problem.
a.) ant install.source
b.) pg_dump
c.) drop+recreate the db
d.) pg_restore
e.) dbconsistency check / ant install.source
No tags attached.
related to defect 00303973.0PR15Q4 closed alostale DB inconsistencies in PG9.5 (alpha1) 
Issue History
2015-01-20 10:18shuehnerNew Issue
2015-01-20 10:18shuehnerAssigned To => alostale
2015-01-20 10:18shuehnerModules => Core
2015-01-20 10:18shuehnerTriggers an Emergency Pack => No
2015-01-20 12:44alostaleIssue Monitored: alostale
2015-01-20 13:56alostaleNote Added: 0073643
2015-01-20 14:15alostaleNote Added: 0073644
2015-01-20 14:16alostaleReview Assigned To => shuehner
2015-01-21 09:00hgbotCheckin
2015-01-21 09:00hgbotNote Added: 0073671
2015-01-21 09:00hgbotStatusnew => resolved
2015-01-21 09:00hgbotResolutionopen => fixed
2015-01-21 09:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b44f867c1a6b464b78b6954647ad130e0ad00a29 [^]
2015-01-21 09:00hgbotCheckin
2015-01-21 09:00hgbotNote Added: 0073672
2015-01-21 09:00hgbotCheckin
2015-01-21 09:00hgbotNote Added: 0073673
2015-01-21 09:00hgbotCheckin
2015-01-21 09:00hgbotNote Added: 0073674
2015-01-21 09:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/b44f867c1a6b464b78b6954647ad130e0ad00a29 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/d7ad35ef4c3628b182059f84f96afdde740a6fe0 [^]
2015-01-26 14:15hgbotCheckin
2015-01-26 14:15hgbotNote Added: 0073779
2015-01-27 13:50hgbotCheckin
2015-01-27 13:50hgbotNote Added: 0073809
2015-01-27 13:50hgbotCheckin
2015-01-27 13:50hgbotNote Added: 0073810
2015-01-27 15:24hgbotCheckin
2015-01-27 15:24hgbotNote Added: 0073815
2015-01-27 15:24hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/d7ad35ef4c3628b182059f84f96afdde740a6fe0 [^] => http://code.openbravo.com/erp/devel/pi/rev/0d3eae75816c97b1aacfd3161edb3965b49335c0 [^]
2015-01-30 08:52hgbotCheckin
2015-01-30 08:52hgbotNote Added: 0073927
2015-02-04 20:34hudsonbotCheckin
2015-02-04 20:34hudsonbotNote Added: 0074169
2015-02-04 20:34hudsonbotCheckin
2015-02-04 20:34hudsonbotNote Added: 0074184
2015-02-04 20:34hudsonbotCheckin
2015-02-04 20:34hudsonbotNote Added: 0074185
2015-02-09 19:41shuehnerNote Added: 0074295
2015-02-09 19:41shuehnerStatusresolved => closed
2015-02-09 19:41shuehnerFixed in Version => 3.0PR15Q2
2015-07-22 08:32alostaleRelationship addedrelated to 0030397
2015-08-10 15:32hgbotCheckin
2015-08-10 15:32hgbotNote Added: 0079291

Notes
(0073643)
alostale   
2015-01-20 13:56   
The differences appear for check constraints in character varying columns, restoring DB adds extra casting in this case.
(0073644)
alostale   
2015-01-20 14:15   
patch sent to try to test in pg 8.4, 9.1, 9.3 and 9.4
(0073671)
hgbot   
2015-01-21 09:00   
Repository: erp/devel/pi
Changeset: b44f867c1a6b464b78b6954647ad130e0ad00a29
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 20 15:59:49 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b44f867c1a6b464b78b6954647ad130e0ad00a29 [^]

fixed bug 28684: incorrect check constraint export in pg 9.3 and 9.4

  The differences appear for check constraints in character varying columns,
  restoring DB adds extra casting in this case.

  The fix takes care of these cases.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0073672)
hgbot   
2015-01-21 09:00   
Repository: erp/devel/dbsm-main
Changeset: be7683ceec8dd22274585dfe06d73e69180ddfde
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 20 13:54:28 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/be7683ceec8dd22274585dfe06d73e69180ddfde [^]

related to bug 28684: added debug log for check constraints

---
M src/org/apache/ddlutils/platform/ModelLoaderBase.java
---
(0073673)
hgbot   
2015-01-21 09:00   
Repository: erp/devel/dbsm-main
Changeset: 174a679ada78fc278771795604f75cef6b40a106
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 20 13:55:56 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/174a679ada78fc278771795604f75cef6b40a106 [^]

related to bug 28684: prevent "assign parameter" waning when doing translations

  It also makes easier to debug.

---
M src/org/apache/ddlutils/translation/CombinedTranslation.java
---
(0073674)
hgbot   
2015-01-21 09:00   
Repository: erp/devel/dbsm-main
Changeset: d7ad35ef4c3628b182059f84f96afdde740a6fe0
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 20 15:49:56 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/d7ad35ef4c3628b182059f84f96afdde740a6fe0 [^]

fixed bug 28684: incorrect check constraint export in pg 9.3 and 9.4

  The differences appear for check constraints in character varying columns,
  restoring DB adds extra casting in this case.

  The fix takes care of these cases.

---
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlCheckTranslation.java
---
(0073779)
hgbot   
2015-01-26 14:15   
Repository: erp/devel/dbsm-main
Changeset: 9a2b319202978c8f83d0fe3e3e20636b3cfc2f77
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jan 23 15:13:22 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/9a2b319202978c8f83d0fe3e3e20636b3cfc2f77 [^]

related to bug 28684: added test case

---
A src-test/src/org/openbravo/dbsm/test/model/CheckConstraints.java
---
(0073809)
hgbot   
2015-01-27 13:50   
Repository: erp/devel/dbsm-main
Changeset: a819e38e4e8b5211bb36f07fb4c8fc5ddf9e22fd
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 27 13:47:16 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/a819e38e4e8b5211bb36f07fb4c8fc5ddf9e22fd [^]

related to bug 28684: added comments

---
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlCheckTranslation.java
---
(0073810)
hgbot   
2015-01-27 13:50   
Repository: erp/devel/dbsm-main
Changeset: a1e9603eb2f002d8f2f7484f8a34e95800047def
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jan 27 13:47:43 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/a1e9603eb2f002d8f2f7484f8a34e95800047def [^]

related to bug 28684: added more test cases covering check constraints

---
M src-test/src/org/openbravo/dbsm/test/model/CheckConstraints.java
---
(0073815)
hgbot   
2015-01-27 15:24   
Repository: erp/devel/pi
Changeset: 0d3eae75816c97b1aacfd3161edb3965b49335c0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 27 15:23:16 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0d3eae75816c97b1aacfd3161edb3965b49335c0 [^]

Related with issue 28684: dbsourcemanager includes previous change

In this changeset [1] a change was done to the dbsourcemanager that was not pushed to its repo. This other changeset [2], which fixes issue 28684, contains a copy of dbsourcemanager.jar that does not included [1].

[1] has just been pushed to the dbsm-main repo, and the dbsourcemanager.jar included in the present changeset contains all the dbsm-main changes up to date.

[1] https://code.openbravo.com/erp/devel/pi/rev/8c34cbb6b4adab030bd7e8c9cf7da00646b54ab2 [^]
[2] https://code.openbravo.com/erp/devel/pi/rev/b44f867c1a6b464b78b6954647ad130e0ad00a29 [^]

---
M src-db/database/lib/dbsourcemanager.jar
---
(0073927)
hgbot   
2015-01-30 08:52   
Repository: erp/devel/dbsm-main
Changeset: 8d8df815a1b30be70ce5c02ffadf5a05c5a6f3bf
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jan 30 08:51:55 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/8d8df815a1b30be70ce5c02ffadf5a05c5a6f3bf [^]

related to bug 28684: [test] typo + removed unused variable

---
M src-test/src/org/openbravo/dbsm/test/model/CheckConstraints.java
---
(0074169)
hudsonbot   
2015-02-04 20:34   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f36c91d0ad63 [^]
Maturity status: Test
(0074184)
hudsonbot   
2015-02-04 20:34   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f36c91d0ad63 [^]
Maturity status: Test
(0074185)
hudsonbot   
2015-02-04 20:34   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f36c91d0ad63 [^]
Maturity status: Test
(0074295)
shuehner   
2015-02-09 19:41   
Reviewed change reg-exp code related to check-constraints. To now also cover the new case of changing text-version of those after doing pg_dump/pg_restore in 9.3/9.4.

Also ran the newly created junit test-cases which cover this expected case + also some other simple+complex check constraint conditions on the following configurations:
- pgsql 8.4.22
- pgsql 9.1.14.
- pgsql 9.3.5
- pgsql 9.4
- oracle 11gr2

Note: pg 9.0 + 9.2 not explicitly tested but those were also never a recommended version.
(0079291)
hgbot   
2015-08-10 15:32   
Repository: erp/devel/dbsm-main
Changeset: 5a8caa93da114c2407081ef191beb3fe81c67360
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 22 09:32:02 2015 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/5a8caa93da114c2407081ef191beb3fe81c67360 [^]

related to bug 30397, related to bug 28684: DB inconsistencies in PG9.5

  Ignoring test cases created for issue 0028684 because they do not apply anymore.

  Now code for checks are read differently so the modifications previously tested
  don't apply anymore.

---
M src-test/src/org/openbravo/dbsm/test/model/CheckConstraints.java
---