The bigger problem is that pgcrypto is 1990s cryptography: it supports Blowfish, has optional authentication, uses all-zeroes IVs, falls back to insecure RNGs, uses old cipher modes, has ambiguous padding...
Don't use pgcrypto. Use libsodium to encrypt in your application.