summaryrefslogtreecommitdiff
path: root/sql/functions/auth.get_user_by_id.sql
blob: d745c4958523d6fc1ef96b3b12b4cc91812b5184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
drop function auth.get_user_by_id (
    p_user_id bigint
);

create or replace function auth.get_user_by_id (
    p_user_id bigint
)
returns setof auth.users
as $$
begin
    return query
    select u.id,
        u.username,
        u.pwd,
        u.first_name,
        u.last_name,
        u.email,
        u.phone,
        u.active,
        u.created
    from auth.users u
    where u.id = p_user_id;

    return;
end;
$$ language plpgsql;