I think I have found a bug with the latest 3.2.3 version. I am installing on Ubuntu with Postgres 9.2.
The following error gets generated on install:
SQL Error DB_ERROR_NO_INDEX_TO_DROP ERROR: 42704: language "PLPGSQL" does not exist LOCATION: CreateFunction, functioncmds.c:867
on the following statement:
CREATE OR REPLACE FUNCTION update_modified_column() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL';
(There is actually and error before this but this statement is shorter and errors out for the same reason.)
With the single quotes round PLPGSQL you are asking it to implicitly use the language PLPGSQL. When you query pg_language its lower case:
select * from pg_language;
lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl
----------+----------+---------+--------------+---------------+-----------+--------------+--------
internal | 10 | f | f | 0 | 0 | 2246 |
c | 10 | f | f | 0 | 0 | 2247 |
sql | 10 | f | t | 0 | 0 | 2248 |
plpgsql | 10 | t | t | 13741 | 13742 | 13743 |
(4 rows)
Changing the above statement to:
CREATE OR REPLACE FUNCTION update_modified_column() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE PLPGSQL;
Makes it work. I am going to attempt to find and modify the install script and see how it goes.
Alex
↧