View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001668 | SymmetricDS | Bug | public | 2014-04-15 16:25 | 2014-08-11 17:49 |
Reporter | cronjefourie | Assigned To | chenson | ||
Priority | urgent | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.6.4 | ||||
Target Version | 3.6.5 | Fixed in Version | 3.6.5 | ||
Summary | 0001668: PostGIS Spatial data replication fails with SRID problem | ||||
Description | The PostGIS replication fails to properly transfer GIS data from the MASTER to SLAVE due to data SRID differences. | ||||
Steps To Reproduce | Create a replication config with a PostGIS GeoSpatial table and non-ZERO SRID. Modify the MASTER Application of changes on the SLAVE will fail. | ||||
Tags | No tags attached. | ||||
|
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>(); |
|
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 |
|
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? |
|
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" ; |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-04-15 16:25 | cronjefourie | New Issue | |
2014-04-15 16:26 | cronjefourie | File Added: issue-1668.patch | |
2014-04-15 16:27 | cronjefourie | Note Added: 0000508 | |
2014-08-11 13:49 | cronjefourie | Note Added: 0000563 | |
2014-08-11 13:57 | chenson | Note Added: 0000564 | |
2014-08-11 13:57 | chenson | Product Version | => 3.6.4 |
2014-08-11 13:57 | chenson | Fixed in Version | => 3.6.5 |
2014-08-11 13:57 | chenson | Target Version | => 3.6.5 |
2014-08-11 13:57 | chenson | Status | new => resolved |
2014-08-11 13:57 | chenson | Resolution | open => fixed |
2014-08-11 13:57 | chenson | Assigned To | => chenson |
2014-08-11 17:49 | chenson | Status | resolved => closed |