summaryrefslogtreecommitdiff
path: root/sql/functions/auth.update_password.sql
blob: 8dc730cfb0a012f27591ab271416e65feaa618ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;