Forum OpenACS Development: When is the plpgsql language installed?

I have a freshly compiled postgres 7.1 using the instructions in the openacs4 guide (found in the old file storage, though). I created a database and some users (including the aolserver owner), and made sure that I could go in postgres on the command line, and create/drop tables. I set up aolserver and it loads the driver (v 2.3), and looking at the logs it seems to talk to postgres just fine. I then downloaded openacs4 from cvs and updated it about 4:00pm today just for good measure.

When I try to bootstrap my ACS installation, it craps out on (the first sql file read?) postgres.sql, complaining that it can't create a function because the language plpgsql is unrecognized. Hmm.. since this is a fresh install of postgres, I checked my LD_LIBRARY_PATH, but the library file plpgsql.so is there. So I checked postgres.sql. Unlike openacs-3.2.4, there is no explicit creation of the plpgsql language, along the lines of

create function plpgsql_call_handler() RETURNS opaque
as '/usr/local/pgsql/lib/plpgsql.so' language 'c';

create trusted procedural language 'plpgsql'
HANDLER plpgsql_call_handler
LANCOMPILER 'PL/pgSQL';
I logged in my database and typed the above manually, and restarted the bootstrap process. Sure enough, the bootstrapping process went on until the "restart aolserver" page (i.e., a successful install).

So, why isn't the creation of the plpgsl "handler" not in postgres.sql? Did I miss something in my installation of postgres? aolserver? We should probably note something in the installation instructions.

BTW, I am really impressed how far along the port has progressed. Good work, guys! I have oracle and postgres, so I should be able to help out in the testing and probably porting.

Collapse
Posted by Dave Bauer on
Good question. A couple of days ago I checkout out EVERYTHING and eventually it all installed at or least said it installed.

Today I just checked out acs-core and I have the same problem. I will try to see what the difference is.

Collapse
Posted by Dave Bauer on
Aha, according to the instructions I used last time when it worked, plpgsql is loaded when you load it. That is do this:

createdb openacs-4
createlang plpgsql openacs-4

But it would be nice if the installer could check and set it up for you, or to make it part of the basic datamodel install.

Check out OpenACS 4 installation.[1]

[1] http://openacs.org:7000/file-storage/download/openacs-4.html?version_id=49

Collapse
Posted by Roberto Mello on
It's better to use the "createlang" script. 'createlang plpgsql mydb'. If you use that against the 'template1' database, then all your databases will have it by default.