问题
I don't know if a similar question was asked before, but I didn't find what i need. I have a table in Postgres database that contains a lot of rows and I need to encrypt one column of this table (and its relative data). In other questions found was mentioned pgcrypto to encrypt columns, but in every example a brand new table is created and pgcrypto is used for INSERT statement and SELECT. Is possible to encrypt column and its preexisting data? I hope everything is clear
回答1:
With pgcrypto module you can do it.
https://www.postgresql.org/docs/current/static/encryption-options.html
There are some examples:
http://www.postgresonline.com/article_pfriendly/165.html
来源:https://stackoverflow.com/questions/50602705/postgres-how-to-encrypt-a-column-and-his-data