How do I install pgcrypto?

posted Apr 28, 2017, 3:55 PM by Sachchida Ojha
1. You will need to request the pgcrypto package from Greenplum Support. Greenplum Support does not support the pgcrypto package downloaded from the postgresql site.

To install pgcrypto on your Greenplum Database cluster follow these instructions:

1.Unzip and untar the pgcrypto package. Two directories are provided in the tar file, lib and share.
2.Copy the lib/postgresl/pgcrypto.so file to $GPHOME/lib/postgresql directory on the Master.
3.Ensure that the owner of the file is the gpadmin user:
chown gpadmin:gpadmin pgcrypto.so
4.You will also need to copy the pgcrypto.so file to all segment servers. To do this run the following command as the gpadmin user:
gpscp -f seg_hostfile $GPHOME/lib/postgresql/gpcrypto.so =:/$GPHOME/lib/postgresql/
5.Set the variable search_path in the pgcrypto.sql file.
6.On the Master you will then need to run the script share/postgresql/contrib/pgcrypto.sql for the database you want to use pgcrypto on. To do this run
the following command:
psql -d DBNAME -ff /Path_to_file/postgresql/contrib/pgcrypto.sql

Once this script is finished you can log in to the database and test pgcrypto.

Latest version of the pgcrypto download contains an executable pgcrypto_install.sh. 
[gpadmin@sachi ~]$ ./pgcrypto_install.sh 
<hosts file> not specified.
./pgcrypto_install.sh -f <hosts file>
[gpadmin@sachi ~]$ 
Comments