Sample Header Ad - 728x90

Is it possible to add encryption capabilities to an already existing table?

0 votes
0 answers
190 views
I'm using pgcrypto module for PostgresSQL, and in the document it was indicated that this line:
CREATE EXTENSION pgcrypto;
should be executed before creating the table which stores encrypted data. My question is, if the table has already been created without the above mentioned line being executed, can I modify the table later by running this line to give it the encryption ability? My goal is to use *pgp_sym_encrypt()* for INSERT operations, *pgp_sym_decrypt()* for SELECT operations and both functions for UPDATE operations. For now I can get prepare statement to work, but exec would fail, I guess because the CREATE EXTENSION line hasn't been run.
Asked by user3554898 (1 rep)
Aug 16, 2022, 06:09 PM
Last activity: Aug 16, 2022, 10:07 PM