Postgres - how to encrypt a column and his data

喜夏-厌秋 提交于 2020-03-23 15:48:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!