Search code examples
postgresqlencryptionpassword-encryption

Can I encrypt posgresql column after I created it?


I have a big (300+ rows) password column and I forgot to encrypt it.

How can I encrypt it now? (in psql) Or which is the best way to encrypt it?


Solution

  • Based on the information you provided in the question, this should help you for now:

    UPDATE 
      table_name 
    SET 
      password = crypt('password',gen_salt('bf'))