Hi all, I'm using postgresql 8.3.5-1.
I just tried today the upgrade and i found the following problems with update.php
1.It is still treating tg.tenabled as a boolean instead of a char.
so i had to remove every instance of the boolean part
WHERE t.tgenabled
to
WHERE t.tgenabled <> \'D\'
2. function update_from_1_0_0rc4_to_1_0_0rc5
This query returns in my case two empty rows for base_user_settings and 1 empty row for base_user_settings_admin_defaults:
//user settings module foreign key
$tabs = array('base_user_settings','base_user_settings_admin_defaults');
foreach ($tabs as $t) {
if(DATABASE_DRIVER=='postgres') {
$idxs = DB::Execute('SELECT t.tgargs as args FROM pg_trigger t,pg_class c,pg_proc p WHERE t.tgenabled <> \'D\' AND t.tgrelid = c.oid AND t.tgfoid = p.oid AND p.proname = \'RI_FKey_check_ins\' AND c.relname = \''.strtolower($t).'\' ORDER BY t.tgrelid');
At this section of the function i see a:
DB::Execute('ALTER TABLE '.$t.' DROP '.$op.' '.$matches[1][$i]);
and since $matches is basically containing null values then the SQL query looks like this:
ALTER TABLE base_user_settings DROP CONSTRAINT;
Making the upgrade fail because of the missing argument.
I've never worked with pg_trigger but maybe if tgnargs is 0 the row should be skipped.
To make my update work i added tgnargs to the where statement as in:
//user settings module foreign key
$tabs = array('base_user_settings','base_user_settings_admin_defaults');
foreach ($tabs as $t) {
if(DATABASE_DRIVER=='postgres') {
$idxs = DB::Execute('SELECT t.tgargs as args FROM pg_trigger t,pg_class c,pg_proc p WHERE t.tgenabled <> \'D\' AND t.tgrelid = c.oid AND t.tgfoid = p.oid AND p.proname = \'RI_FKey_check_ins\' AND c.relname = \''.strtolower($t).'\' AND t.tgnargs > 0 ORDER BY t.tgrelid');
Even tho the update works i'm not sure (yet again) if this is an isolated case due to my local configuration and if not what would be a good fix.
Thanks.