IDEMPIERE-1132 Improve AD_Index; AD_View; foreign keys management / improve discovery of unique index - postgresql message in spanish has different quoting

This commit is contained in:
Carlos Ruiz 2013-11-08 12:14:14 -05:00
parent b1d7fd674b
commit c786868a61
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,7 @@ import com.mchange.v2.c3p0.ComboPooledDataSource;
/**
* PostgreSQL Database Port
*
* @author @author Jorg Janke, Victor P<EFBFBD>rez
* @author @author Jorg Janke, Victor Perez
* @version $Id: DB_PostgreSQL.java,v 1.23 2005/03/11 20:29:01 jjanke Exp $
* ---
* Modifications: removed static references to database connection and instead always
@ -1099,9 +1099,13 @@ public class DB_PostgreSQL implements AdempiereDatabase
public String getNameOfUniqueConstraintError(Exception e) {
String info = e.getMessage();
int fromIndex = info.indexOf("\"");
if (fromIndex == -1)
fromIndex = info.indexOf("\u00ab"); // quote for spanish postgresql message
if (fromIndex == -1)
return info;
int toIndex = info.indexOf("\"", fromIndex + 1);
if (toIndex == -1)
toIndex = info.indexOf("\u00bb", fromIndex + 1);
if (toIndex == -1)
return info;
return info.substring(fromIndex + 1, toIndex);