Failure to load plpgsql.so - Mailing list pgsql-general

From Matthew Pounsett
Subject Failure to load plpgsql.so
Date
Msg-id A9A6BC42-D2E2-471B-BFB0-F6A72EF42911@conundrum.com
Whole thread Raw
Responses Re: Failure to load plpgsql.so  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I’m in the process of installing mediawiki, and ran into this error while it was setting up the database:

    • Query:
CREATE FUNCTION page_deleted() RETURNS TRIGGER LANGUAGE plpgsql AS $mw$ BEGIN DELETE FROM recentchanges WHERE
rc_namespace= OLD.page_namespace AND rc_title = OLD.page_title; RETURN NULL; END; $mw$ 
    • Function: DatabaseBase::sourceFile( /usr/local/www/mediawiki/maintenance/postgres/tables.sql )
    • Error: 58P01 ERROR: could not load library "/usr/local/lib/postgresql/plpgsql.so": dlopen
(/usr/local/lib/postgresql/plpgsql.so)failed: /usr/local/lib/postgresql/plpgsql.so: Undefined symbol
"HeapTupleHeaderGetDatum"

I’ve done some searching and found a few instances of this error with people installing either mediawiki or other
softwareapplications that use postgresql 9.3, but no solutions to the problem yet.   It seems commonly suggested that
thereis a linking problem during compile of postgresql, resulting in psql 9.2 (or earlier) libraries being linked into
a9.3 server, but in my case I can’t see that as a reasonable explanation.  

The client server running mediawiki is FreeBSD 9.3-RELEASE running psql 9.3.5
 > uname -a
FreeBSD redacted 9.3-RELEASE FreeBSD 9.3-RELEASE #0 r268512: Thu Jul 10 23:44:39 UTC 2014
root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 
> psql --version
psql (PostgreSQL) 9.3.5

The server is FreeBSD 9.2-p10 running the same version of psql:
> uname -a
FreeBSD redacted 9.2-RELEASE-p10 FreeBSD 9.2-RELEASE-p10 #0: Tue Jul  8 10:48:24 UTC 2014
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 
> postgres --version
postgres (PostgreSQL) 9.3.5

The packages on both systems were built by tinderbox, a package building application for FreeBSD.  It builds packages
fromthe FreeBSD ports tree, in chrooted environments for the target operating system, for later binary installation.
Thetinderbox server in question is brand new, and has never even had a psql 9.2 tarball on it .. let alone built a 9.2
serveror client, which is why I’m not inclined to go with the mismatched library suggestion.  The postgresql server was
recentlyupgraded from psql 9.0 however, so I can see how it might be possible for something to be amiss there.   I have
double-checkedthat the version of plpgsql.so installed on the database server is in fact part of the psql 9.3.5 package
whichwas just compiled last night. 

> pkg info -l postgresql93-server | grep plpgsql.so
        /usr/local/lib/postgresql/plpgsql.so
-rwxr-xr-x  1 root  wheel  158736 Aug 24 01:52 /usr/local/lib/postgresql/plpgsql.so

Can anyone make suggestions for other things I should look at in tracking down this error?  I did a search on the psql
communitysupport page, and it looks as if this problem has not been discussed on the psql lists before. 

My thanks in advance for any assistance.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to insert either a value or the column default?
Next
From: Tom Lane
Date:
Subject: Re: Failure to load plpgsql.so