diff --git a/base/src/org/adempiere/pipo/PackInHandler.java b/base/src/org/adempiere/pipo/PackInHandler.java index de4bfa9448..df3b9d08c5 100644 --- a/base/src/org/adempiere/pipo/PackInHandler.java +++ b/base/src/org/adempiere/pipo/PackInHandler.java @@ -2518,14 +2518,28 @@ public class PackInHandler extends DefaultHandler { String DBType = atts.getValue("DBType"); PreparedStatement pstmt = DB.prepareStatement(atts.getValue("statement"), m_trxName); try { - if(DBType.equals("ALL")){ + if(DBType.equals("ALL")) { int n = pstmt.executeUpdate(); log.info("Executed SQL Statement: "+ atts.getValue("statement")); } - else if(DB.isOracle() == true && DBType.equals("Oracle")){ + else if(DB.isOracle() == true && DBType.equals("Oracle")) { pstmt.executeUpdate(); log.info("Executed SQL Statement for Oracle: "+ atts.getValue("statement")); } + else if(DB.isPostgreSQL() == true && DBType.equals("PostgreSQL")){ + // Avoid convert layer - command specific for postgresql + // + // pstmt = DB.prepareStatement(sql, null); + // pstmt.executeUpdate(); + // + Connection m_con = DB.getConnectionRW(true); + Statement stmt = m_con.createStatement(); + int n = stmt.executeUpdate (atts.getValue("statement")); + log.info("Executed SQL Statement for PostgreSQL: "+ atts.getValue("statement")); + // Postgres needs to commit DDL statements + if (m_con != null && !m_con.getAutoCommit()) + m_con.commit(); + } /* else if(DB.isSybase() == true && DBType.equals("Sybase")){ pstmt.executeUpdate(); log.info("Exceuted SQL Statement for Sybase");