Re: proposal: unescape_text function

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: unescape_text function
Дата
Msg-id CAFj8pRBwrnotQzzVmG8s1i+cZ=h0FNv08Q=OcG+9NPMy7jkZ6g@mail.gmail.com
обсуждение исходный текст
Ответ на proposal: unescape_text function  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: unescape_text function  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers


po 22. 6. 2020 v 5:48 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal:
Hi

There is one user request for unescape function in core.


This request is about possibility that we do with string literal via functional interface instead string literals only

I wrote plpgsql function, but built in function can be simpler:

CREATE OR REPLACE FUNCTION public.unescape(text, text) RETURNS textLANGUAGE plpgsqlAS $function$DECLARE result text;BEGIN  EXECUTE format('SELECT U&%s UESCAPE %s',                         quote_literal(replace($1, '\u','^')),                        quote_literal($2)) INTO result;  RETURN result;END;$function$
postgres=# select unescape('Odpov\u011Bdn\u00E1 osoba','^');   unescape     
-----------------Odpovědná osoba
(1 row)
What do you think about this?

I changed the name to more accurately "unicode_unescape". Patch is assigned

Regards

Pavel


Regards

Pavel
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Assertion failure in pg_copy_logical_replication_slot()
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation