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

Collapse
Posted by Gustaf Neumann on
From 5.1 to 5.5 is a long way! The most simple fix is probably to drop the index and run the update script again.
Collapse
Posted by Ratnakar Sagare on
Can u please specify which index to drop & how to drop it?

I am sorry but I am newbie in databases.

Thanks
Ratnakar

Collapse
Posted by Gustaf Neumann on
in psql:

drop index cr_revisions_publish_date_idx;

Collapse
Posted by Dave Bauer on
To expand a bit:

[13/Nov/2009:15:41:42][7538.3071388560][-conn:76-] Error:

Failed to install Content Repository, version 5.5.0d3. The following error was generated:

psql:upgrade-5.2.0d11-5.2.0d12.sql:1: ERROR: relation "cr_revisions_publish_date_idx" already exists

It shows that cr_revisions_publish_date_idx already exists when the upgrade script is trying to create it.

You can safely drop the index since the upgrade script will recreate it.

The command gustaf posted will work.

drop index cr_revisions_publish_date_idx;

You need to execute that from the Postgresql shell by running the command

psql databasename from a command line where database name is whatever you called the database when it was created.

TO learn more about indexes see http://www.postgresql.org/docs/8.2/interactive/sql-dropindex.html

In general typing "postgresql drop index" or "postgresql whatever" into a search engine will bring up the appropriate documentation.

Collapse
Posted by Ratnakar Sagare on
Hi,
I tried this command & able to go forward from the error. but still the package installation is not successful & this time the error is like this:
------------------------------------------------------
Error: apm_package_install: Error installing Content Repository version 5.5.0d3: psql:upgrade-5.2.0d16-5.2.0d17.sql:101: ERROR: column *NEW*.object_package_id does not exist
CONTEXT: SQL statement "create rule images_r as on insert to imagesi do instead (
update cr_dummy set val = (
select content_revision__new(
new.title,
new.description,
now(),
new.mime_type,
new.nls_language,
case when new.text is null
then new.data
else new.text
end,
content_symlink__resolve(new.item_id),
new.revision_id,
now(),
new.creation_user,
new.creation_ip,
new.object_package_id
));
insert into images ( image_id, width, height ) values (cr_dummy.val, new.width, new.height); );"
PL/pgSQL function "content_type__refresh_trigger" line 73 at execute statement
SQL statement "SELECT content_type__refresh_trigger ( $1 )"
PL/pgSQL function "inline_0" line 9 at select into variables

psql:upgrade-5.2.0d16-5.2.0d17.sql:101: ERROR: column *NEW*.object_package_id does not exist
CONTEXT: SQL statement "create rule images_r as on insert to imagesi do instead (
update cr_dummy set val = (
select content_revision__new(
new.title,
new.description,
now(),
new.mime_type,
new.nls_language,
case when new.text is null
then new.data
else new.text
end,
content_symlink__resolve(new.item_id),
new.revision_id,
now(),
new.creation_user,
new.creation_ip,
new.object_package_id
));
insert into images ( image_id, width, height ) values (cr_dummy.val, new.width, new.height); );"
PL/pgSQL function "content_type__refresh_trigger" line 73 at execute statement
SQL statement "SELECT content_type__refresh_trigger ( $1 )"
PL/pgSQL function "inline_0" line 9 at select into variables

invoked from within
"db_source_sql_file -callback $callback $path/$file_path"
(procedure "apm_package_install_data_model" line 32)
invoked from within
"apm_package_install_data_model -callback $callback -data_model_files $data_model_files $spec_file_path"
invoked from within
"if { $load_data_model_p } {
apm_package_install_data_model -callback $callback -data_model_files $data_model_files $spec_file_path
..."
("uplevel" body line 55)
invoked from within
"uplevel $body "
[19/Nov/2009:16:18:25][4763.3065854864][-conn:2-] Error:

Failed to install Content Repository, version 5.5.0d3. The following error was generated:

psql:upgrade-5.2.0d16-5.2.0d17.sql:101: ERROR: column *NEW*.object_package_id does not exist
CONTEXT: SQL statement "create rule images_r as on insert to imagesi do instead (
update cr_dummy set val = (
select content_revision__new(
new.title,
new.description,
now(),
new.mime_type,
new.nls_language,
case when new.text is null
then new.data
else new.text
end,
content_symlink__resolve(new.item_id),
new.revision_id,
now(),
new.creation_user,
new.creation_ip,
new.object_package_id
));
insert into images ( image_id, width, height ) values (cr_dummy.val, new.width, new.height); );"
PL/pgSQL function "content_type__refresh_trigger" line 73 at execute statement
SQL statement "SELECT content_type__refresh_trigger ( $1 )"
PL/pgSQL function "inline_0" line 9 at select into variables

NOTE: If the error comes from a sql script you may try to source it manually. When you are done with that you should revisit the APM and try again but remember to leave the manually souced sql scipts unchecked on the previous page.

--------------------------------------------------------
Can you please look into this?
Thanks,
Ratnakar