Revision: 5023
http://sourceforge.net/p/jump-pilot/code/5023
Author: michaudm
Date: 2016-09-20 20:45:17 +0000 (Tue, 20 Sep 2016)
Log Message:
-----------
Postgis writer : create the sequence in the same schema as the table
Modified Paths:
--------------
core/trunk/ChangeLog
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis/SaveToPostGISDataSource.java
Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog 2016-09-20 11:47:26 UTC (rev 5022)
+++ core/trunk/ChangeLog 2016-09-20 20:45:17 UTC (rev 5023)
@@ -3,6 +3,9 @@
# 2. make sure that lines break at 80 chars for constricted display situations
#<-------------------------------- 80 chars
---------------------------------->#
+2016-09-21 mmichaud <[email protected]>
+ * Postgis writer : create the sequence in the same schema as the table
+
2016-09-17 mmichaud <[email protected]>
* FR #235 : Improved ExtractLayersByGeometryPlugIn
* Fix bug happening when modifying schema two times with InfoPanel opened
Modified:
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis/SaveToPostGISDataSource.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis/SaveToPostGISDataSource.java
2016-09-20 11:47:26 UTC (rev 5022)
+++
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis/SaveToPostGISDataSource.java
2016-09-20 20:45:17 UTC (rev 5023)
@@ -387,10 +387,10 @@
String dbTable, String primaryKey) throws
SQLException {
String tableFullName = SQLUtil.compose(dbSchema, dbTable);
String sql_test_seq = "SELECT * FROM information_schema.sequences\n" +
- " WHERE sequence_schema = 'public' AND sequence_name =
'openjump_dbid_sequence';";
- String sql_create_seq = "CREATE SEQUENCE openjump_dbid_sequence;";
+ " WHERE sequence_schema = '" + dbSchema + "' AND
sequence_name = 'openjump_dbid_sequence';";
+ String sql_create_seq = "CREATE SEQUENCE \"" + dbSchema +
"\".openjump_dbid_sequence;";
String sql_create_dbid = "ALTER TABLE " + tableFullName + " ADD COLUMN
\"" +
- primaryKey + "\" BIGINT DEFAULT
nextval('openjump_dbid_sequence') PRIMARY KEY;";
+ primaryKey + "\" BIGINT DEFAULT nextval('\"" + dbSchema +
"\".openjump_dbid_sequence') PRIMARY KEY;";
boolean sequence_already_exists;
// check if openjump_dbid_sequence already exists
try {
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel