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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034094
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] Y. DBSourceManagerminorhave not tried2016-09-26 18:022016-11-25 17:38
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionduplicateFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034094: Support exporting and importing sampledata using PostgreSQL's COPY

DescriptionPostgreSQL provides a fast way to export and import from the database to CSV files using its COPY functionality [1].

It would be great if the ExportSampledata and ImportSampledata classes could be adapted to optionally export/import using PostgreSQL's COPY.

As this functionality is not available as is in Oracle, the export and import tasks will only work with XML in this platform.

[1] https://www.postgresql.org/docs/9.4/static/sql-copy.html [^]
Steps To Reproduce-
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
duplicate of feature request 0033875 closedAugustoMauch Importing/Exporting sample data using PostgreSQL's COPY instead of current XML 

-  Notes
(0091857)
hgbot (developer)
2016-11-25 17:38

Repository: erp/devel/dbsm-main
Changeset: 3f7817dd375e67085af81a188e0198d354ce4230
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Sep 20 12:44:04 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/3f7817dd375e67085af81a188e0198d354ce4230 [^]

Related with issue 34094: export.sample.data can export using PG copy format

An exportFormat parameter can be specified to the export.sample.data task, its supported values are xml (as usual) and copy (uses PostgreSQL's COPY to export to CSV). The copy export format is only supported in PostgreSQL, if the underlying database is Oracle then the xml format is always used.

This is a summary of the changes:
- src/org/apache/ddlutils/io/DataSetTableExporter: A new interface to be implemented by the classes that are going to export the database tables in different formats.i
- src/org/apache/ddlutils/io/DatabaseDataIO.java: It implements now the DataSetTableExporter. The implementation of the required method invokes writeDataForTableToXML, the method that has been used so far to export a dataset table to XML
- src/org/apache/ddlutils/io/PgCopyDatabaseDataIO.java: A new class that implementes DataSetTableExporter and that exports a dataset table to CSV using PostgreSQL's copy.
- src/org/openbravo/ddlutils/task/ExportSampledata.java: It accepts now an exportFormat parameter. Uses that parameter to determine the extension of the files that will be created and the DataSetTableExporter that should be uses to export the dataset tables.

---
M src/org/apache/ddlutils/io/DatabaseDataIO.java
M src/org/openbravo/ddlutils/task/ExportSampledata.java
A src/org/apache/ddlutils/io/DataSetTableExporter.java
A src/org/apache/ddlutils/io/PgCopyDatabaseDataIO.java
---
(0091858)
hgbot (developer)
2016-11-25 17:38

Repository: erp/devel/dbsm-main
Changeset: 56dccf20d76bf7d8e8a1df9d6b5f0bae965aa40a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Sep 27 11:43:15 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/56dccf20d76bf7d8e8a1df9d6b5f0bae965aa40a [^]

Related with issue 34094: import.sample.data can import using PG copy format

The import.sample.data now supports importing .copy files that have been generated using the export.sample.data task with the .copy file extension. It only works in PostgreSQL, in Oracle those files will be skipped.

Summary of the changes:
- src/org/apache/ddlutils/io/PgCopyDatabaseDataIO.java: Adds the method that actually imports a .copy into the database using PostgreSQL's COPY
- src/org/openbravo/ddlutils/task/DatabaseUtils.java: Adds a filter to read .copy files from the reference data folder. Before this change only the .xml files were considered.
- src/org/openbravo/ddlutils/task/ImportSampledata.java: Reads both .copy and .xml files from the reference data folder. Depending on the extensions it uses DatabaseDataIO or PgCopyDatabaseDataIO to import the file into the database.

---
M src/org/apache/ddlutils/io/PgCopyDatabaseDataIO.java
M src/org/openbravo/ddlutils/task/DatabaseUtils.java
M src/org/openbravo/ddlutils/task/ImportSampledata.java
---

- Issue History
Date Modified Username Field Change
2016-09-26 18:02 AugustoMauch New Issue
2016-09-26 18:02 AugustoMauch Assigned To => platform
2016-09-26 18:02 AugustoMauch Modules => Core
2016-09-26 18:02 AugustoMauch Triggers an Emergency Pack => No
2016-09-26 18:02 AugustoMauch Assigned To platform => AugustoMauch
2016-10-28 13:47 AugustoMauch Relationship added duplicate of 0033875
2016-10-28 13:47 AugustoMauch Status new => closed
2016-10-28 13:47 AugustoMauch Resolution open => duplicate
2016-11-25 17:38 hgbot Checkin
2016-11-25 17:38 hgbot Note Added: 0091857
2016-11-25 17:38 hgbot Checkin
2016-11-25 17:38 hgbot Note Added: 0091858


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker