I'm trying to run the sha256
function in HeidiSQL, but I'm getting that function doesn't exist. The query is the following:
UPDATE db_name.users
SET db_name.users.password = sha256(db_name.users.password)
WHERE user_id = (secret_numeric_id);
Is anything I'm doing wrong about the query or is HeidiSQL itself?
Here's the error message:
ERROR: function sha256(character varying) does not exist.
LINE 2: SET db_name.users.password = sha256(db_name.users.password)
HINT: No function matches in name and argument types. It may be necessary to add explicit type conversion.
EDIT
Running the following query:
UPDATE db_name.users
SET db_name.users.password = sha256(convert_to(db_name.users.password), 'LATIN1')
WHERE user_id = (secret_numeric_id);
I'm getting the same error message, with different param type:
ERROR: function sha256(bytea) does not exist.
LINE 2: SET db_name.users.password = sha256(db_name.users.password)
HINT: No function matches in name and argument types. It may be necessary to add explicit type conversion.