Forum OpenACS Q&A: Re: upgrading content repository package gives error

Ratnakar,

You will be able to look into this yourself.

The error thrown is :

ERROR: column *NEW*.object_package_id does not exist

It was thrown when a database 'rule' was being set up:

create rule images_r as on insert to imagesi do instead

which roughly means "if anyone tries to insert data into imagesi, do what follows instead".

The 'NEW.' part refers to data associated with a row that is about to be entered:

http://www.postgresql.org/docs/8.3/static/plpgsql-trigger.html

So what this means is that the object_package_id field is either not present in the new row to be added, or not present in the data model.

That means that somewhere in the upgrade scripts between 5.1 and 5.5 this field has been added to the data model, but has not been added into the 5.5 upgrade script.

I recommend you study each upgrade script (starting at 5.2) to work out where this field was added. You could then either add the field manually and re-run your 5.5 upgrade script, or even upgrade your CR to the version in which the field was added first and then upgrade to 5.5 afterwards.

When you identify the appropriate details please post back here in case anyone else needs to upgrade to 5.5 from 5.1 in future. You could even suggest a patch to the core team if you felt so inclined.

Regards
Richard