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:
parent
b1d7fd674b
commit
c786868a61
|
@ -60,7 +60,7 @@ import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
/**
|
/**
|
||||||
* PostgreSQL Database Port
|
* 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 $
|
* @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
|
* 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) {
|
public String getNameOfUniqueConstraintError(Exception e) {
|
||||||
String info = e.getMessage();
|
String info = e.getMessage();
|
||||||
int fromIndex = info.indexOf("\"");
|
int fromIndex = info.indexOf("\"");
|
||||||
|
if (fromIndex == -1)
|
||||||
|
fromIndex = info.indexOf("\u00ab"); // quote for spanish postgresql message
|
||||||
if (fromIndex == -1)
|
if (fromIndex == -1)
|
||||||
return info;
|
return info;
|
||||||
int toIndex = info.indexOf("\"", fromIndex + 1);
|
int toIndex = info.indexOf("\"", fromIndex + 1);
|
||||||
|
if (toIndex == -1)
|
||||||
|
toIndex = info.indexOf("\u00bb", fromIndex + 1);
|
||||||
if (toIndex == -1)
|
if (toIndex == -1)
|
||||||
return info;
|
return info;
|
||||||
return info.substring(fromIndex + 1, toIndex);
|
return info.substring(fromIndex + 1, toIndex);
|
||||||
|
|
Loading…
Reference in New Issue