diff --git a/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java b/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java index 1a1585f9d8d..afad8ecaff4 100644 --- a/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java +++ b/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java @@ -897,6 +897,11 @@ public String sqlStringForValue(Object v, String kp) { EOEntity kpEntity = entityForKeyPath(kp); attribute = kpEntity.attributeNamed(kp.substring(lastDotIdx+1)); } + // AK: inet6 addresses get handed down as "xxx:xxx:...:xxx%y", not "xxx:xxx:...:xxx/y" + // note that this might break if you hand over a host name that contains percent chars (not sure if possible) + if(attribute != null && "inet".equals(attribute.externalType()) && v != null && v.toString().indexOf('%') > 0) { + v = v.toString().replace('%', '/'); + } if(attribute != null && v != null && v != NSKeyValueCoding.NullValue) { String s = columnTypeStringForAttribute(attribute); return super.sqlStringForValue(v, kp) + "::" + s;