databases/postgresql7 dump + restore didn't include pgcrypto functions

Dan Langille dan at
Fri Jan 30 18:10:48 PST 2004

Hi folks,

I upgraded two servers today from 7.3.* to 7.4.1.  In both cases, the 
pgcrypto functions were excluded.  I used pg_dumpall to create the 
output.  Examining the dump file I see this:

connect ""
-- PostgreSQL database dump


SET search_path = public, pg_catalog;

-- TOC entry 235 (OID 19127468)
-- Name: digest (text, text); Type: FUNCTION; Schema: public; Owner: 

CREATE FUNCTION digest (text, text) RETURNS bytea
    AS '$libdir/pgcrypto', 'pg_digest'

But within that database, there is no digest function: \df digest
                   List of functions
 Result data type | Schema | Name | Argument data types
(0 rows)

The cause of the problem is illustrated by this attempt to manually 
create the functions:

freshports=# CREATE FUNCTION digest (text, text) RETURNS bytea
freshports-#     AS '$libdir/pgcrypto', 'pg_digest'
freshports-#     LANGUAGE c;
ERROR:  could not load library 
"/usr/local/lib/postgresql/": dlopen 
'/usr/local/lib/postgresql/' failed. (/us
r/local/lib/postgresql/ Undefined symbol "elog")

It appears that the libraries were removed.  Does that make sense?

I upgraded using portupgrade.  I wonder if that's why 
/usr/local/lib/postgresql was blown away....

What I had to do was recompile and install contrib/pgcrypto and then 
import the functions.

FWIW: I was using the FreeBSD port on 4.9-STABLE.
Dan Langille :
BSDCan -

More information about the freebsd-ports mailing list