diff --git a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java index 101f915767..eb3f7124da 100644 --- a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java +++ b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java @@ -911,6 +911,17 @@ public class Convert_PostgreSQL extends Convert_SQL92 { if (alias.indexOf('(') > 0) alias = alias.substring(0, alias.indexOf('(')); String converted = sqlStatement.replaceFirst("\\s"+alias+"\\s", " "); converted = converted.replaceAll("\\b"+alias+"\\.", table+"."); + converted = converted.replaceAll("[+]"+alias+"\\.", "+"+table+"."); + converted = converted.replaceAll("[-]"+alias+"\\.", "-"+table+"."); + converted = converted.replaceAll("[*]"+alias+"\\.", "*"+table+"."); + converted = converted.replaceAll("[/]"+alias+"\\.", "/"+table+"."); + converted = converted.replaceAll("[%]"+alias+"\\.", "%"+table+"."); + converted = converted.replaceAll("[<]"+alias+"\\.", "<"+table+"."); + converted = converted.replaceAll("[>]"+alias+"\\.", ">"+table+"."); + converted = converted.replaceAll("[=]"+alias+"\\.", "="+table+"."); + converted = converted.replaceAll("[|]"+alias+"\\.", "|"+table+"."); + converted = converted.replaceAll("[(]"+alias+"\\.", "("+table+"."); + converted = converted.replaceAll("[)]"+alias+"\\.", ")"+table+"."); return converted; } else { return sqlStatement; diff --git a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java index 014945d319..22fbcf732d 100644 --- a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java +++ b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java @@ -28,6 +28,22 @@ public final class Convert_PostgreSQLTest { String sqe; String[] r; + //[ 1707959 ] Copy from other PrintFormat doesn't work anymore + sql = "UPDATE AD_PrintFormatItem_Trl new " + + "SET (PrintName, PrintNameSuffix, IsTranslated) = (" + + "SELECT PrintName, PrintNameSuffix, IsTranslated " + + "FROM AD_PrintFormatItem_Trl old " + + "WHERE old.AD_Language=new.AD_Language" + + " AND AD_PrintFormatItem_ID =0) " + + "WHERE AD_PrintFormatItem_ID=1" + + " AND EXISTS (SELECT AD_PrintFormatItem_ID " + + " FROM AD_PrintFormatItem_trl old" + + " WHERE old.AD_Language=new.AD_Language" + + " AND AD_PrintFormatItem_ID =2)"; + sqe = "UPDATE AD_PrintFormatItem_Trl SET PrintName=\"old\".PrintName,PrintNameSuffix=\"old\".PrintNameSuffix,IsTranslated=\"old\".IsTranslated FROM AD_PrintFormatItem_Trl \"old\" WHERE \"old\".AD_Language=AD_PrintFormatItem_Trl.AD_Language AND \"old\".AD_PrintFormatItem_ID =0 AND AD_PrintFormatItem_Trl.AD_PrintFormatItem_ID=1 AND EXISTS (SELECT AD_PrintFormatItem_ID FROM AD_PrintFormatItem_trl \"old\" WHERE \"old\".AD_Language=AD_PrintFormatItem_Trl.AD_Language AND AD_PrintFormatItem_ID =2)"; + r = convert.convert(sql); + verify(sql, r, sqe); + //[ 1707611 ] Column synchronization for mandatory columns doesn't work sql = "ALTER TABLE Test MODIFY T_Integer NUMBER(10) NOT NULL"; sqe = "ALTER TABLE Test ALTER COLUMN T_Integer TYPE NUMERIC(10); ALTER TABLE Test ALTER COLUMN T_Integer SET NOT NULL;";