Forum OpenACS Q&A: Function bittoint4(bit) does not exist

Hi,
I recently updated my site from openacs4.6.1 to openacs4.6.3 and then I updated from postgres 7.2 to version 7.3.15

The site appears and I can surf it fine. When I try to add or change things using blogger, or when I try to change the parameters of the kernal using the admin tool, I'm getting these sorts of errors:

Function bittoint4(bit) does not exist

I guess the problem is in the acs-kernal/sql/postgres/upgrade/ scripts. or in acs-kernal/sql/postgres/upgrade/postgresql.sql

Did I not run one of the upgrade scripts (I thought I did) or did I not get the right version of postgresql.sql when I checked it out from cvs.openacs.org? Or is my version of postgres broken? There's not much info on this in the forums. Any thoughts on how to proceed?

[data]$ postmaster --version
postmaster (PostgreSQL) 7.3.15

Eric

Collapse
Posted by Dave Bauer on
It looks like some function was not transferred correctly when you updated the database.

PG 4.6.1 and up was compatible with PG 7.3

The bittoint4 function used to be included in PG 7.2, but in 7.3 it had to be created for OpenACS. Its likely the upgrade script did not handle the fact that in 7.2 bittoint4 was a native function.

The fix is to execute the following command

psql -f packages/acs-kernel/sql/postgresql/postgesql.sql DBNAME

where dbname is the postgresql database name. Execute that from the openacs install root directory or modify the path to point to the postgresql.sql under acs-kernel.

Collapse
Posted by Dave Bauer on
Make sure this code is in postgresql.sql if you still have problems after you reload it.

http://cvs.openacs.org/cvs/openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql?r1=1.30&r2=1.31

Collapse
Posted by Eric Wolfram on
Thanks. That fixed it as far as I can tell.

psql -f packages/acs-kernel/sql/postgresql/postgesql.sql DBNAME

I was sure I already ran that and I didn't want to try it again. Upon running it again, I got a lot of errors "function ___ already exists" or "ERROR: Relation ____ already exists", but it also did create and drop a few functions. Maybe it missed those first time around and I didn't notice the errors?

Thanks!
e

Collapse
Posted by Jun Yamog on
Hi Eric,

"already exists" errors should be ok and expected if you run packages/acs-kernel/sql/postgresql/postgesql.sql

The create and drop of functions must be the inline_* functions.

Collapse
Posted by Tom Craftino on
What`s file atrebute of postgesql.sql?
___________________________________________
Nasty Credit Cards - Training Courses at UK Virtual College