Все базы данных в одной репе

This commit is contained in:
2024-10-29 08:23:11 +03:00
parent 71ef9e72b6
commit be4aeb5975
19 changed files with 1093 additions and 0 deletions

17
function1.sql Normal file
View File

@@ -0,0 +1,17 @@
create or replace function convert_to_initials(
p_name varchar,
p_surname varchar,
p_patronymic varchar
) returns varchar as $$
begin
if p_name is null or p_name = '' or p_surname is null or p_surname = '' then
return '';
end if;
if p_patronymic is null or p_patronymic = '' then
return concat(substring(p_name from 1 for 1), '. ', p_surname);
end if;
return concat(substring(p_patronymic from 1 for 1), '. ', substring(p_name from 1 for 1), '. ', p_surname);
end;
$$ language plpgsql;