Forum OpenACS Q&A: Postgres RPMs --with-tcl

Posted by Qris Trotje on
I'm using RedHat 6.2 with PostgreSQL which was installed from RPMs without the tcl option. Since I now understand that I need PostgreSQL installed --with-tcl to run the bboard search feature, I'd like to know if there are any RPMs created with the tcl option turned on.

Also I'd like to know if I need to do anything special to my current OpenACS databases while I perform the upgrade to the new PostgreSQL RPMs.

Posted by Don Baccus on
I'll answer the second one - the new PG RPMs are, I assume, the PG 7.1 RPMs. If you've got an existing PG 7.0 installation you need to:

  • PG_DUMP your existing database.
  • Stop the postmaster
  • move your data directory to a safe place as a backup (/usr/local/pgsql/data in a standard installation build from source).
  • make and install PG 7.1
  • initdb
  • start postmaster
  • createuser your_user
  • createdb your_db;createlnag plpgsql your_db; createlang pltcl your_db
  • psql your_db -f your_dmp.dmp
  • vacuum analyze your_db
  • rebuild the Postgres driver (get latest source from sourceforge)
  • restart openacs.
Posted by Jonathan Marsden on
Qris, I'm looking at this right now for my OpenACS RPMs. They want
PG 7.1, so I think that's what you are looking to upgrade to.

I think just installing the postgresql-tcl binary RPM will give you
the library needed for the bboard search just fine.  So it is just
one extra (small) binary RPM to download and install, no need to
have a different set of PG RPMs for this at all. The PG 7.1
postgresql-tcl RPM needs the tcl 8.0 RPM installed too, but that will
be on your RH CD anyway, and quite possibly already installed on
your machine.

I'll post again when  I confirm this by actually trying out the
OpenACSSearch search method for bboards on a test machine here...
maybe within a few hours.

Posted by Jonathan Marsden on
Well... my initial test failed. But I don't know if it is a result of any issue with, or something else. I think that it is more likely to be something else. The log message says that the function rank_for_search(unknown, text) does not exist. But that is not a function.

AHA! OK, I discovered www/doc/rank_for_search.sql. Despite being an OpenACS addition, it doesn't seem to be referenced by the OpenACS documentation.

Anyway, if after adding the postgresql-tcl RPM, I do

su - postgres -c "createlang pltcl acs"
psql -e -U postgres acs acs < /var/lib/aolserver/server/defaultacs/www/doc/rank_for_search.sql

then it works fine. So no special RPMs are needed, just postgresql-tcl as created by Lamar Owen, and then the two commands above (adjust for your database name and PG user (both are acs in my case) and the location of your OpenACS tree).

Clearly, it would be nice if this process were documented somewhere. Maybe in the OpenACS Getting Started Guide would work?

Roberto: Is that the right place to do this? Or should it be considered an optional installation step, and therefore go in the OpenACS Installation Guide instead? Once I know, I'll have a go at a patch for the relevant document. Also, I'll patch ad.tcl to add a couple of comment lines just above the OpenACSSearchP setting.

That was instructive, I just learnt a bit more about debugging OpenACS :-)

Thinking slightly longer term, it would be neat if the OpenACS RPMs could set a trigger on the presence/absence of the postgresql-tcl RPM, and adjust things accordingly... this way bboard searches would "just work" if you had postgresql-tcl installed.

Posted by Jonathan Marsden on
Correcting myself... the two commands should be

su - postgres -c "createlang pltcl acs"
psql -U acs acs < /var/lib/aolserver/servers/defaultacs/www/doc/sql/rank-for-search.sql
Posted by Qris Trotje on
Thanks Jonathan

All I needed were the two commands you supplied above and now the search is activated.