Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014642Openbravo ERPA. Platformpublic2010-09-22 09:222010-10-30 11:24
jpabloae 
marvintm 
normalmajorhave not tried
closedfixed 
202.6.34
main 
3.0RC3 
Core
No
0014642: PostgreSQL 9.0 support: replace pg_trigger.tgisconstraint
pg_trigger.tgisconstraint has been removed from PostgreSQL 9.0. This makes the install.source to throw this error:

create.database.all:
Database connection: jdbc:postgresql://localhost:5433/exp_full_pgsql9. [^] User: exp_full_pgsql9
Executing default prescript
SQL Command failed with: ERROR: column pg_trigger.tgisconstraint does not exist
-- END

CREATE OR REPLACE VIEW USER_OBJECTS
(TABLE_NAME, OBJECT_NAME, OBJECT_ID, OBJECT_TYPE, STATUS)
AS
SELECT UPPER(PG_CLASS.RELNAME), UPPER(PG_TRIGGER.TGNAME), PG_TRIGGER.TGFOID, TO_CHAR('TRIGGER'), CASE is_Trigger_Enabled(PG_TRIGGER.TGNAME) WHEN TRUE THEN TO_CHAR('VALID') ELSE TO_CHAR('INVALID') END
FROM PG_TRIGGER, PG_NAMESPACE, PG_CLASS
WHERE PG_TRIGGER.TGRELID = PG_CLASS.OID
AND PG_TRIGGER.TGISCONSTRAINT = FALSE
AND PG_CLASS.RELNAMESPACE = PG_NAMESPACE.OID
AND PG_NAMESPACE.NSPNAME = CURRENT_SCHEMA()
Executed 116 SQL command(s) with 1 error(s)

See http://builds.openbravo.com/job/exp-full-pgsql9/3/console [^] for the complete console output.

As we intend to support it for 3.0, we should ideally find a way of checking this so that it works in 8.3, 8.4 and 9.0 at the same time.

Some additional information from http://www.postgresql.org/community/weeklynews/pwn20100117: [^]

"(...) I also replaced the tgisconstraint column with tgisinternal; the old meaning of tgisconstraint can now be had by testing for nonzero tgconstraint, while there is no other way to get the old meaning of nonzero tgconstraint, namely that the trigger was internally generated rather than being user-created. (...)"
postgresql9-support
related to defect 0022286 closed AugustoMauch Remove view user_objects (again) as it is unused and is causing trouble when upgrading from pgsql8.4 to >= pgsql9 
Issue History
2010-09-22 09:22jpabloaeNew Issue
2010-09-22 09:22jpabloaeAssigned To => marvintm
2010-09-22 09:22jpabloaeIssue Monitored: shuehner
2010-09-22 09:23jpabloaeTag Attached: postgresql9-support
2010-09-24 15:35hgbotCheckin
2010-09-24 15:35hgbotNote Added: 0031353
2010-09-24 15:35hgbotStatusnew => resolved
2010-09-24 15:35hgbotResolutionopen => fixed
2010-09-24 15:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d6f404defcf2da5444e4dd71d81f981de9a8db1c [^]
2010-09-28 11:10hgbotCheckin
2010-09-28 11:10hgbotNote Added: 0031405
2010-09-29 11:57hudsonbotCheckin
2010-09-29 11:57hudsonbotNote Added: 0031465
2010-09-29 11:57hudsonbotCheckin
2010-09-29 11:57hudsonbotNote Added: 0031470
2010-10-27 11:18shuehnerNote Added: 0032249
2010-10-27 11:18shuehnerStatusresolved => closed
2010-10-30 11:24anonymoussf_bug_id0 => 3098734
2012-11-13 15:03shuehnerRelationship addedrelated to 0022286

Notes
(0031353)
hgbot   
2010-09-24 15:35   
Repository: erp/devel/pi
Changeset: d6f404defcf2da5444e4dd71d81f981de9a8db1c
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Fri Sep 24 15:33:32 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d6f404defcf2da5444e4dd71d81f981de9a8db1c [^]

Fixed issue 14642. Removed the view so that the Openbravo full build works in PostgreSQL 9.0

---
M src-db/database/model/prescript-PostgreSql.sql
---
(0031405)
hgbot   
2010-09-28 11:10   
Repository: erp/devel/pi
Changeset: f6316be65fe77b292d63ec79d32bace38cebf0a7
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Sep 28 11:09:22 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f6316be65fe77b292d63ec79d32bace38cebf0a7 [^]

Related to issue 14642. Readded the view so that ad_script_disable/enable_triggers still work, but with a small change so that it works in PostgreSQL 8.4 and 9.0

---
M src-db/database/model/postscript-PostgreSql.sql
M src-db/database/model/prescript-PostgreSql.sql
---
(0031465)
hudsonbot   
2010-09-29 11:57   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/d6f404defcf2 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/51c2c2967221 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18452.obx [^]
(0031470)
hudsonbot   
2010-09-29 11:57   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/f6316be65fe7 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/51c2c2967221 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18452.obx [^]
(0032249)
shuehner   
2010-10-27 11:18   
Reviewed & tested.
Testing using delete client process which is the only one which uses this changed view on postgres. Working fine on pgsql8.4.5 and pgsql9.0.1.
New view definition does remove two columns from the view which where not used and as this view is not part of the official api there's no api problem because of that change.