From 5981061dcf0eae41abdb5d00248c864535fdfd16 Mon Sep 17 00:00:00 2001 From: Shi Jinghai Date: Sun, 4 Sep 2016 08:57:44 +0000 Subject: [PATCH] OFBIZ-8137 Entityname starts with schema name causes error in PostgreSQL git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759155 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java index 73c678d4ed..a7f7e76e7c 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java @@ -1001,7 +1001,7 @@ public class DatabaseUtil { String tableName = tableSet.getString("TABLE_NAME"); // for those databases which do not return the schema name with the table name (pgsql 7.3) boolean appendSchemaName = false; - if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName)) { + if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName + "\\.")) { appendSchemaName = true; } if (needsUpperCase && tableName != null) { @@ -3042,7 +3042,7 @@ public class DatabaseUtil { String tableName = rawTableName; // for those databases which do not return the schema name with the table name (pgsql 7.3) boolean appendSchemaName = false; - if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName)) { + if (tableName != null && lookupSchemaName != null && !tableName.startsWith(lookupSchemaName + "\\.")) { appendSchemaName = true; } if (needsUpperCase && tableName != null) {