Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036916
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajorhave not tried2017-09-21 13:392018-01-03 12:38
ReporteralostaleView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision1e4b3cd5380e
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase version10Ant version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036916: PG10: update.database fails if there are DB sequences

DescriptionIf an instance running in PostgreSQL 10 contains sequences, update.database fails.
Steps To Reproduce1. Copy attached C_MYSEQ.xml file to src-db/database/model/sequences
2. run ant update.database (OK this one just creates the sequence)
3. run ant update.database
   -> ERROR
     [java] 6119 ERROR - ERROR: column "min_value" does not exist
     [java] Position: 8
     [java] org.postgresql.util.PSQLException: ERROR: column "min_value" does not exist
     [java] Position: 8
     [java] at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
     [java] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
     [java] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
     [java] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:622)
     [java] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:472)
     [java] at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:386)
     [java] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
     [java] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
     [java] at org.apache.ddlutils.platform.ModelLoaderBase.readList(ModelLoaderBase.java:831)
Proposed SolutionThis is caused because in PostgreSQL 10 metadata for sequences is not stored anymore in the sequence itself but in a new pg_sequence table, see [1] and [2].

[1] https://github.com/postgres/postgres/commit/1753b1b027035029c2a2a1649065762fafbf63f3#diff-c92b082294555dab71dce6c00393f1c7 [^]
[2] https://www.depesz.com/2017/02/06/waiting-for-postgresql-10-add-pg_sequence-system-catalog/ [^]
TagsNo tags attached.
Attached Filesxml file icon C_MYSEQ.xml [^] (128 bytes) 2017-09-21 13:43

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0028143 closedalostale The database sequences are exported to xml files including also the next value 
blocks feature request 0036911 closedalostale support PostgreSQL 10 

-  Notes
(0099776)
hgbot (developer)
2017-10-05 16:12

Repository: erp/devel/dbsm-main
Changeset: 23b31796a9ca76f94c7427185efa98450011eb02
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Oct 05 15:55:47 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/23b31796a9ca76f94c7427185efa98450011eb02 [^]

related to issue 36916: PG10 - update.database fails if there are DB sequences

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src/org/apache/ddlutils/PlatformFactory.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
M src/org/apache/ddlutils/task/DatabaseTaskBase.java
M src/org/apache/ddlutils/task/PlatformConfiguration.java
M src/org/openbravo/ddlutils/task/CheckAPI.java
M src/org/openbravo/ddlutils/task/CheckAPIDistribution.java
M src/org/openbravo/ddlutils/task/CreateXML2SQL.java
A src/org/apache/ddlutils/platform/OracleStandardBatchEvaluator.java
A src/org/apache/ddlutils/platform/oracle/OracleBuilder.java
A src/org/apache/ddlutils/platform/oracle/OracleModelReader.java
A src/org/apache/ddlutils/platform/oracle/OraclePlatform.java
A src/org/apache/ddlutils/platform/postgresql/PostgreSql10ModelLoader.java
A src/org/apache/ddlutils/platform/postgresql/PostgreSql10Platform.java
R src/org/apache/ddlutils/PlatformUtils.java
R src/org/apache/ddlutils/platform/Oracle8StandardBatchEvaluator.java
R src/org/apache/ddlutils/platform/oracle/Oracle10Builder.java
R src/org/apache/ddlutils/platform/oracle/Oracle10ModelReader.java
R src/org/apache/ddlutils/platform/oracle/Oracle10Platform.java
R src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
R src/org/apache/ddlutils/platform/oracle/Oracle8ModelReader.java
R src/org/apache/ddlutils/platform/oracle/Oracle8Platform.java
R src/org/apache/ddlutils/platform/oracle/Oracle9Platform.java
---
(0099777)
hgbot (developer)
2017-10-05 16:18

Repository: erp/devel/pi
Changeset: 1e4b3cd5380ef93703b356c4e81dcd56ab654a59
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Oct 05 16:00:35 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1e4b3cd5380ef93703b356c4e81dcd56ab654a59 [^]

fixes issue 36916: PG10 - update.database fails if there are DB sequences

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099792)
alostale (developer)
2017-10-06 12:29

reviewed

tested with PostgreSQL 10.0 (final)

executed also complete dbsm test suite
(0101318)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-09-21 13:39 alostale New Issue
2017-09-21 13:39 alostale Assigned To => platform
2017-09-21 13:39 alostale Modules => Core
2017-09-21 13:39 alostale Triggers an Emergency Pack => No
2017-09-21 13:42 alostale Proposed Solution updated
2017-09-21 13:43 alostale File Added: C_MYSEQ.xml
2017-09-21 13:43 alostale Relationship added blocks 0036911
2017-09-21 13:43 alostale Status new => acknowledged
2017-09-21 14:05 alostale Relationship added related to 0028143
2017-10-02 19:23 caristu Assigned To platform => caristu
2017-10-02 19:23 caristu Status acknowledged => scheduled
2017-10-05 16:12 hgbot Checkin
2017-10-05 16:12 hgbot Note Added: 0099776
2017-10-05 16:18 hgbot Checkin
2017-10-05 16:18 hgbot Note Added: 0099777
2017-10-05 16:18 hgbot Status scheduled => resolved
2017-10-05 16:18 hgbot Resolution open => fixed
2017-10-05 16:18 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1e4b3cd5380ef93703b356c4e81dcd56ab654a59 [^]
2017-10-05 16:18 caristu Review Assigned To => alostale
2017-10-06 12:29 alostale Note Added: 0099792
2017-10-06 12:29 alostale Status resolved => closed
2017-10-06 12:29 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101318


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker