View Issue Details

IDProjectCategoryView StatusLast Update
0001668SymmetricDSBugpublic2014-08-11 13:49
ReportercronjefourieAssigned Tochenson 
Priorityurgent 
Status closedResolutionfixed 
Product Version3.6.4 
Target Version3.6.5Fixed in Version3.6.5 
Summary0001668: PostGIS Spatial data replication fails with SRID problem
DescriptionThe PostGIS replication fails to properly transfer GIS data from the MASTER to SLAVE due to data SRID differences.
Steps To ReproduceCreate a replication config with a PostGIS GeoSpatial table and non-ZERO SRID.
Modify the MASTER
Application of changes on the SLAVE will fail.
TagsNo tags attached.

Activities

cronjefourie

2014-04-15 12:26

reporter  

issue-1668.patch (769 bytes)
Index: PostgreSqlTriggerTemplate.java
===================================================================
--- PostgreSqlTriggerTemplate.java	(revision 8168)
+++ PostgreSqlTriggerTemplate.java	(working copy)
@@ -65,6 +65,7 @@
         oldTriggerValue = "old" ;
         oldColumnPrefix = "" ;
         newColumnPrefix = "" ;
+        geometryColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"SRID='||ST_SRID($(tableAlias).\"$(columnName)\")|| ';' || ST_ASTEXT($(tableAlias).\"$(columnName)\") || '\"' end" ;
         otherColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' || cast($(tableAlias).\"$(columnName)\" as varchar) || '\"' end" ;
 
         sqlTemplates = new HashMap<String,String>();
issue-1668.patch (769 bytes)

cronjefourie

2014-04-15 12:27

reporter   ~0000508

Added a fix by writing out the data SRID to the TEXT data. Assuming the SRID of the MASTER and SLAVE tables are kept the same, which makes logical sense this should resolve the problem

cronjefourie

2014-08-11 09:49

reporter   ~0000563

Hi guys. I submitted this patch some time ago. Any reason why it's not been included in the source yet?

Is there any other way or me to commit updates to the code base than via patch files like these?

chenson

2014-08-11 09:57

administrator   ~0000564

Coincidentally, this is fixed as part of another issue in 3.6.5.

Ended up using:

geometryColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then '' else '\"' || replace(replace(cast(ST_AsEWKT($(tableAlias).\"$(columnName)\") as varchar),$$\\$$,$$\\\\$$),'\"',$$\\\"$$) || '\"' end" ;

Issue History

Date Modified Username Field Change
2014-04-15 12:25 cronjefourie New Issue
2014-04-15 12:26 cronjefourie File Added: issue-1668.patch
2014-04-15 12:27 cronjefourie Note Added: 0000508
2014-08-11 09:49 cronjefourie Note Added: 0000563
2014-08-11 09:57 chenson Note Added: 0000564
2014-08-11 09:57 chenson Product Version => 3.6.4
2014-08-11 09:57 chenson Fixed in Version => 3.6.5
2014-08-11 09:57 chenson Target Version => 3.6.5
2014-08-11 09:57 chenson Status new => resolved
2014-08-11 09:57 chenson Resolution open => fixed
2014-08-11 09:57 chenson Assigned To => chenson
2014-08-11 13:49 chenson Status resolved => closed