Forum OpenACS Q&A: Re: Postgresql 7.3 packaged...

Collapse
Posted by Bart Teeuwisse on

Some of the many changes in PostgreSQL 7.3 broke compatibility with OpenACS. Here's a list of incompatibilities I've found so far and how to fix them:

  1. bitfromint4 and bittoint4 have been dropped in favour of the more comon bit and int4. Fix: replace bitfromin4 with "bit" (including the quotes!) and replace bittoint4 with "int4".
  2. Type casting has been overhauled. Implicit integer to varchar type casts have become a thing of the past. Fix: create a copy of the declaration of each Pl/PGSQL function that accepts integers in a varchar parameter. Change the type of that parameter in the copy to integer. Perform an explicit cast in the copy and call the original.
  3. Another type cast casualty is the implicit casting from timestamptz to timestamp. Timestamp (without time zone) has become the default timestamp format. However current_timestamp still returns timestamptz values. Fix: replace timestamp parameters in PL/PGSQL functions with timestamptz.
  4. The function int_to_tree_key needs a explicit cast as the new "bit" function doesn't accept double precision parameters. The outcome of -2^31 + p_intkey computation is of double precision and needs to be casted to int4 like so:
    "bit"(cast (-2^31 + p_intkey as int4))

That is it so far. OpenACS is still not working with PG 7.3. To be continued....

/Bart

Collapse
Posted by Andrei Mitran on
Did you ever get OpenACS working with Postgres 7.3? If so, which version of OpenACS? Any other errors and fixes?

Andrei

Collapse
Posted by Bart Teeuwisse on
Andrei,

checkout a copy of OpenACS from the CVS HEAD and download PostgreSQL 7.3.1 from the PostgreSQL ftp server and you are good to go.

/Bart

Collapse
Posted by Andrei Mitran on
What about the 4.6 branch?

Andrei

Collapse
Posted by Bart Teeuwisse on
Andrei,

CVS HEAD != OpenACS 4.6. To use PG 7.3.1 You'll have to use the HEAD.

/Bart

Collapse
Posted by tammy m on
Will the postgresql 7.3.1 patches be applied to OACS 4.6 anytime soon?