Change HID function types to char(5) as in DB
This commit is contained in:
parent
920c8cff01
commit
d246c9bf33
@ -84,13 +84,13 @@ as $$
|
|||||||
$$ language sql stable rows 10;
|
$$ language sql stable rows 10;
|
||||||
|
|
||||||
|
|
||||||
create function generate_hid() returns text as $$
|
create function generate_hid() returns char(5) as $$
|
||||||
select string_agg(substr('abcdefghijklmnopqrstuvwxyz', ceil(random() * 26)::integer, 1), '') from generate_series(1, 5)
|
select string_agg(substr('abcdefghijklmnopqrstuvwxyz', ceil(random() * 26)::integer, 1), '') from generate_series(1, 5)
|
||||||
$$ language sql volatile;
|
$$ language sql volatile;
|
||||||
|
|
||||||
|
|
||||||
create function find_free_system_hid() returns text as $$
|
create function find_free_system_hid() returns char(5) as $$
|
||||||
declare new_hid text;
|
declare new_hid char(5);
|
||||||
begin
|
begin
|
||||||
loop
|
loop
|
||||||
new_hid := generate_hid();
|
new_hid := generate_hid();
|
||||||
@ -100,8 +100,8 @@ end
|
|||||||
$$ language plpgsql volatile;
|
$$ language plpgsql volatile;
|
||||||
|
|
||||||
|
|
||||||
create function find_free_member_hid() returns text as $$
|
create function find_free_member_hid() returns char(5) as $$
|
||||||
declare new_hid text;
|
declare new_hid char(5);
|
||||||
begin
|
begin
|
||||||
loop
|
loop
|
||||||
new_hid := generate_hid();
|
new_hid := generate_hid();
|
||||||
|
Loading…
Reference in New Issue
Block a user