diff options
Diffstat (limited to 'sql/functions/auth.update_password.sql')
| -rw-r--r-- | sql/functions/auth.update_password.sql | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/functions/auth.update_password.sql b/sql/functions/auth.update_password.sql new file mode 100644 index 0000000..8dc730c --- /dev/null +++ b/sql/functions/auth.update_password.sql @@ -0,0 +1,19 @@ +drop function auth.update_password ( + p_id bigint, + p_pwd character varying +); + +create or replace function auth.update_password ( + p_id bigint, + p_pwd character varying +) +returns bigint +as $$ +begin + update auth.users + set pwd = digest(p_pwd, 'sha512') + where id = p_id; + + return p_id; +end; +$$ language plpgsql; |
