sh4rkyy
sh4rkyy

Reputation: 402

How to convert password to MD5

I've got a column user_password where passwords are stored with bytea datatype.

I want to select all columns in this table, and password to be converted in the results into MD5.

Currently examplary password is like this 4\323\227\120\0817Z\303\101

I'm using postgresql.

Upvotes: 0

Views: 440

Answers (2)

sh4rkyy
sh4rkyy

Reputation: 402

Jeeez. It was so easy I didn't even realized. just select md5(login_password) worked.

Upvotes: 0

Siva
Siva

Reputation: 1529

Using update query

 update table_name set user_password = MD5(user_password)

Upvotes: 1

Related Questions