How do I install pgcrypto?

 

If you are going to use credit card processing or if you're getting this message ERROR:  function decrypt(bytea, bytea, unknown) does not exist then you need to install pgcrypto. Pgcrypto is a library used for encrypting sensitive data. The pgcrypto software is a popular add-on package included with the PostgreSQL source code distribution. The pgcrypto module is used by our credit card encryption functionality.  Even if you are not processing credit cards, we still recommend that pgcrypto be installed. 

First, we need to locate the pgcrypto.sql file.  One typical path to this is:  /usr/local/pgsql/share/contrib/pgcrypto.sql

If it isn't there you can always search for the file.  You may need to perform the search as root:  find / | grep pgcrypto.sql (be patient, this takes awhile)  Or if you're on Windows just use the Windows file search.

Once you've located the file the next step is to install it.  The command to install pgcrypto onto your database is: psql -U mfgadmin NameOfDB < /wherever/the/file/is/pgcrypto.sql  Or if you prefer using pgAdmin, connect to the database you want to install pgcrypto and open/execute pgcrypto.sql through the SQL Editor.  It is also a good idea to install pgcrypto.sql on the template1 database.

pgcrypto install error

Apparently you need pgcrypto to run xTuple Manufacturing. When using the command line sequence (from the "How do I install pgcrypto?) listed above accounting for the difference in user and path I get the following:

"ERROR: could not access file "$libdir/pgcrypto": No such file or directory"

Any Ideas

I highly recommend installing

I highly recommend installing Postgres, and pgcrypto, from an RPM (if running Redhat/fedora) and not from a .tar if possible. My issue was partially installed pgcrypto by a .tar where everywhere you looked it was there but aparently not seen by the system. Installed pgcrypto with an RPM and now have pgcrypto running. You will need pgcrypto for the "Accounting" tab in customers if you have any transactions associated with the customer.