Forum OpenACS Development: get_value__parameter_id error

Hi

I'm checking this error when adding a comment:

ERROR: column "get_value__parameter_id" does not exist at character 128
QUERY: select attr_value from apm_parameter_values v
where v.package_id = get_value__package_id
and parameter_id = get_value__parameter_id

As Gustaf suggests it might be a problem upgrading (I think it's relating with some other problems when upgrading from 5.5 to 5.8).

I'll check this out and keep the solution here.

Regards,
Cesáreo

Collapse
Posted by Cesareo Garci­a Rodicio on
I've checked if this function exists in my database (and it doesn't)

 \df get_value*
\df get_value*
                       List of functions
 Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)

Seeking with these problem, I see it has already reported but ...

I check apm-create.file and it seems to be fine;

> grep "parameter_id =" acs-kernel/sql/postgresql/apm-create.sql
and parameter_id = v_parameter_id; and parameter_id = v_parameter_id; where parameter_id = v_parameter_id where parameter_id = v_parameter_id
Collapse
Posted by Gustaf Neumann on
try the following when calling psql with you database name:
\x
\df+ apm__get_value
you should see two functions with different argument types.
-g
Collapse
Posted by Cesareo Garci­a Rodicio on
Yes, two functions:

openacs=# \df apm__get_value*
\df apm__get_value*
List of functions
-[ RECORD 1 ]-------+-------------------------------------
Schema              | public
Name                | apm__get_value
Result data type    | character varying
Argument data types | character varying, character varying
Type                | normal
-[ RECORD 2 ]-------+-------------------------------------
Schema              | public
Name                | apm__get_value
Result data type    | character varying
Argument data types | integer, character varying
Type                | normal
Collapse
Posted by Gustaf Neumann on
The bug was introduced between OpenACS 5.6.0 and OpenACS 5.7.0 and effects only upgrades. i wonder, why we don't see more complaints about this. Anyhow, i've added an upgrade script to the oacs-5-8 branch. Please either upgrade from CVS, or wait until tomorrow and do an "upgrade from repository" when you are using OpenACS 5.8.0.

-gustaf

Collapse
Posted by Cesareo Garci­a Rodicio on
As you wish. It sounds "more general" to use "upgrade from repository" but I can test whether option you want.
Collapse
Posted by Gustaf Neumann on
please try tomorrow "upgrade from repo" .. -g
Collapse
Posted by Cesareo Garci­a Rodicio on
Update Kernel:
acs-admin ... Install Software ... Upgrade from Repository

Kernel from 5.8.1d3 to 5.8.1d4

Restart and ... voilá 😊 Thanks

Collapse
Posted by Gustaf Neumann on
As a summary: The error from apm__get_value is not related to broken upgrades, the same error existed as well at openacs.org. The reason, why we do not see more complaints about this basic functionality (retrieving a package parameter) is that this SQL function is only seldomly called (e.g. parameter::get uses its own sql statements). In the future, we should either drop the function or use and extend it (currently there is no support for global package parameters from the sql functions).