Re: proposal: unescape_text function

From: David Steele <david(at)pgmasters(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: unescape_text function
Date: 2021-03-10 13:52:50
Message-ID: 84352699-8af3-9071-f641-4dd01773cc3b@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/2/20 1:30 PM, Pavel Stehule wrote:
> st 2. 12. 2020 v 11:37 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com
> st 2. 12. 2020 v 9:23 odesílatel Peter Eisentraut
>
> Heh.  The fact that there is a table of two dozen possible
> representations kind of proves my point that we should be
> deliberate in
> picking one.
>
> I do see Oracle unistr() on that list, which appears to be very
> similar
> to what you are trying to do here.  Maybe look into aligning
> with that.
>
> unistr is a primitive form of proposed function.  But it can be used
> as a base. The format is compatible with our  "4.1.2.3. String
> Constants with Unicode Escapes".
>
> What do you think about the following proposal?
>
> 1. unistr(text) .. compatible with Postgres unicode escapes - it is
> enhanced against Oracle, because Oracle's unistr doesn't support 6
> digits unicodes.
>
> 2. there can be optional parameter "prefix" with default "\". But
> with "\u" it can be compatible with Java or Python.
>
> What do you think about it?
>
> I thought about it a little bit more, and  the prefix specification has
> not too much sense (more if we implement this functionality as function
> "unistr"). I removed the optional argument and renamed the function to
> "unistr". The functionality is the same. Now it supports Oracle
> convention, Java and Python (for Python UXXXXXXXX) and \+XXXXXX. These
> formats was already supported.The compatibility witth Oracle is nice.

Peter, it looks like Pavel has aligned this function with unistr() as
you suggested. Thoughts?

Regards,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-03-10 14:00:59 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message John Naylor 2021-03-10 13:47:35 Re: get rid of <foreignphrase> tags in the docs?