Re: proposal: unescape_text function

From: Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: unescape_text function
Date: 2020-07-28 12:02:28
Message-ID: CADM=JeheQAN2p9r-4U4PXgugYipYkKk5NgHc5UcKcoR4mzmyMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 2, 2020 at 10:10 PM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:

>
>
> čt 2. 7. 2020 v 17:27 odesílatel Daniel Gustafsson <daniel(at)yesql(dot)se>
> napsal:
>
>> > On 23 Jun 2020, at 11:51, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> wrote:
>>
>> > I changed the name to more accurately "unicode_unescape". Patch is
>> assigned
>>
>> You've made this function return Oid, where it used to be void. Was that
>> a
>> copy-paste mistake? Else the code needs fixing as it doesn't return an
>> Oid.
>>
>> +Oid
>> +check_unicode_value(pg_wchar c)
>> +{
>> + if (!is_valid_unicode_codepoint(c))
>> + ereport(ERROR,
>> + (errcode(ERRCODE_SYNTAX_ERROR),
>> + errmsg("invalid Unicode escape value")));
>> +}
>>
>>
> yes, it is my error
>
> I am sending fixed patch
>
> Thank you for check
>
> Pavel
>
> cheers ./daniel
>>
>

Hi Pavel,

Since the idea originated from unescaping unicode string literals i.e.
select unescape('Odpov\u011Bdn\u00E1 osoba');

Shouldn't the built-in function support the above syntax as well?

--
Asif Rehman
Highgo Software (Canada/China/Pakistan)
URL : www.highgo.ca

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2020-07-28 13:43:08 Re: [HACKERS] [PATCH] Generic type subscripting
Previous Message Hamid Akhtar 2020-07-28 11:35:07 Re: Should we remove a fallback promotion? take 2