Re: proposal: unescape_text function
David Steele <david@pgmasters.net>
From: David Steele <david@pgmasters.net>
To: Pavel Stehule <pavel.stehule@gmail.com>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Asif Rehman <asifr.rehman@gmail.com>, Daniel Gustafsson
<daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-10T13:52:50Z
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.stehule@gmail.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@pgmasters.net
Commits
-
Add unistr function
- f37fec837ce8 14.0 landed