diff --git a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java index b7df9455b7..cb24bc0c0e 100644 --- a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java +++ b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQL.java @@ -45,8 +45,7 @@ public class Convert_PostgreSQL extends Convert_SQL92 { /** Logger */ private static CLogger log = CLogger.getCLogger(Convert_PostgreSQL.class); - /** Vector to save previous values of quoted strings **/ - private Vector retVars = new Vector(); + /** * Is Oracle DB @@ -69,9 +68,18 @@ public class Convert_PostgreSQL extends Convert_SQL92 { // remove comments String statement = sqlStatement; - statement = replaceQuotedStrings(statement); - statement = convertMapStatement(removeComments(statement)); - statement = recoverQuotedStrings(statement); + /** Vector to save previous values of quoted strings **/ + Vector retVars = new Vector(); + try + { + statement = replaceQuotedStrings(statement,retVars); + statement = convertMapStatement(removeComments(statement)); + statement = recoverQuotedStrings(statement,retVars); + } + catch (RuntimeException e) { + System.err.println(sqlStatement); + throw e; + } // log.info("------------------------------------------------------------"); // log.info(statement); // log.info("------------------->"); @@ -163,7 +171,7 @@ public class Convert_PostgreSQL extends Convert_SQL92 { return retValue; } // convertSimpleStatement - private String replaceQuotedStrings(String retValue) { + private String replaceQuotedStrings(String retValue, VectorretVars) { // save every value // Pattern p = Pattern.compile("'[[\\w]*[-:,\\(\\)]*[ ]*]*'"); // Carlos Ruiz - globalqss - better matching regexp @@ -177,7 +185,7 @@ public class Convert_PostgreSQL extends Convert_SQL92 { return retValue; } - private String recoverQuotedStrings(String retValue) { + private String recoverQuotedStrings(String retValue, VectorretVars) { Pattern p = Pattern.compile("<-->", REGEX_FLAGS); Matcher m = p.matcher(retValue); for (int cont = 0; cont < retVars.size(); cont++) {