Possibly a bug - Mailing list pgsql-bugs

From Анатолий
Subject Possibly a bug
Date
Msg-id c743e514-40c7-4960-96a6-38d9f17eaf76@email.su
Whole thread Raw
Responses Re: Possibly a bug
Re: Possibly a bug
List pgsql-bugs
Hello.
If the user parameter is passed to a function, the other parameter is not converted to uppercase (if it is cirillic). The same with procedures and if you swap the params.


create or replace function to_upper_first(param1 text, param2 text)
returns text as
$$
    select upper(param1) || ' ' || upper(param2) || ' ' || param2;
$$ language sql;

select version();
select  to_upper_first('тест', user::text);

Output:134 ms

CREATE FUNCTION                                                      version                                                       
-------------------------------------------------------------------------------------------------------------------- PostgreSQL 18.1 (Debian 18.1-1.pgdg13+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
(1 row)
                     to_upper_first                     
-------------------------------------------------------- тест USER_44D38K4ZB_44D4GQVSV user_44d38k4zb_44d4gqvsv
(1 row)

https://onecompiler.com/postgresql/44d4fxa3x

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

select  to_upper_first('test', user::text);

to_upper_first                     
-------------------------------------------------------- TEST USER_44D38K6QJ_44D4GTCEM user_44d38k6qj_44d4gtcem
(1 row)


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19398: Non-existent repositories are used
Next
From: Tom Lane
Date:
Subject: Re: Possibly a bug