Re: proposal: unescape_text function

2021-03-29 Thread Pavel Stehule
po 29. 3. 2021 v 12:19 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > On 25.03.21 10:44, Peter Eisentraut wrote: > > > > On 10.03.21 14:52, David Steele wrote: > >>> I thought about it a little bit more, and the prefix specification > >>> has not too much sense (more

Re: proposal: unescape_text function

2021-03-29 Thread Peter Eisentraut
On 25.03.21 10:44, Peter Eisentraut wrote: On 10.03.21 14:52, David Steele wrote: 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

Re: proposal: unescape_text function

2021-03-25 Thread Peter Eisentraut
On 10.03.21 14:52, David Steele wrote: 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

Re: proposal: unescape_text function

2021-03-10 Thread David Steele
On 12/2/20 1:30 PM, Pavel Stehule wrote: st 2. 12. 2020 v 11:37 odesílatel Pavel Stehule 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

Re: proposal: unescape_text function

2020-12-02 Thread Bruce Momjian
On Wed, Dec 2, 2020 at 07:30:39PM +0100, Pavel Stehule wrote: > postgres=# select >  'Arabic     : ' || unistr( '\0627\0644\0639\0631\0628\064A\0629' )      || ' >   Chinese    : ' || unistr( '\4E2D\6587' )                               || ' >   English    : ' || unistr( 'English' )              

Re: proposal: unescape_text function

2020-12-02 Thread Pavel Stehule
st 2. 12. 2020 v 11:37 odesílatel Pavel Stehule napsal: > > > st 2. 12. 2020 v 9:23 odesílatel Peter Eisentraut < > peter.eisentr...@enterprisedb.com> napsal: > >> On 2020-11-30 22:15, Pavel Stehule wrote: >> > I would like some supporting documentation on this. So far we only >> > have

Re: proposal: unescape_text function

2020-12-02 Thread Chapman Flack
On 12/02/20 09:55, Chapman Flack wrote: > In Perl, there is a useful extension to regexp substitution where > you specify the replacement not as a string or even a string with & > and \1 \2 ... magic, but as essentially a lambda that is passed the > match and returns a computed replacement. That

Re: proposal: unescape_text function

2020-12-02 Thread Chapman Flack
On 12/02/20 05:37, Pavel Stehule wrote: > 2. there can be optional parameter "prefix" with default "\". But with "\u" > it can be compatible with Java or Python. Java's unicode escape form is one of those early ones that lack a six-digit form, and where any character outside of the basic

Re: proposal: unescape_text function

2020-12-02 Thread Andrew Dunstan
On 12/2/20 12:48 AM, Pavel Stehule wrote: > > > st 2. 12. 2020 v 0:05 odesílatel Andrew Dunstan > napsal: > > > On 11/30/20 8:14 AM, Peter Eisentraut wrote: > > On 2020-11-29 18:36, Pavel Stehule wrote: > >> > >>     I don't really get the point of

Re: proposal: unescape_text function

2020-12-02 Thread Pavel Stehule
st 2. 12. 2020 v 9:23 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > On 2020-11-30 22:15, Pavel Stehule wrote: > > I would like some supporting documentation on this. So far we only > > have > > one stackoverflow question, and then this implementation, and

Re: proposal: unescape_text function

2020-12-02 Thread Peter Eisentraut
On 2020-11-30 22:15, Pavel Stehule wrote: I would like some supporting documentation on this.  So far we only have one stackoverflow question, and then this implementation, and they are not even the same format.  My worry is that if there is not precise specification, then

Re: proposal: unescape_text function

2020-12-01 Thread Pavel Stehule
st 2. 12. 2020 v 0:05 odesílatel Andrew Dunstan napsal: > > On 11/30/20 8:14 AM, Peter Eisentraut wrote: > > On 2020-11-29 18:36, Pavel Stehule wrote: > >> > >> I don't really get the point of this function. There is AFAICT no > >> function to produce this escaped format, and it's not a

Re: proposal: unescape_text function

2020-12-01 Thread Andrew Dunstan
On 11/30/20 8:14 AM, Peter Eisentraut wrote: > On 2020-11-29 18:36, Pavel Stehule wrote: >> >>     I don't really get the point of this function.  There is AFAICT no >>     function to produce this escaped format, and it's not a recognized >>     interchange format.  So under what circumstances

Re: proposal: unescape_text function

2020-12-01 Thread Pavel Stehule
út 1. 12. 2020 v 20:20 odesílatel Chapman Flack napsal: > >> po 30. 11. 2020 v 22:15 odesílatel Pavel Stehule < > pavel.steh...@gmail.com> > >> napsal: > >>> I checked this and it is "prefix backslash-u hex" used by Java, > >>> JavaScript or RTF - > >>>

Re: proposal: unescape_text function

2020-12-01 Thread Chapman Flack
>> po 30. 11. 2020 v 22:15 odesílatel Pavel Stehule >> napsal: >>> I checked this and it is "prefix backslash-u hex" used by Java, >>> JavaScript or RTF - >>> https://billposer.org/Software/ListOfRepresentations.html If I look on that page, it appears that RTF is using a similar-looking escape

Re: proposal: unescape_text function

2020-11-30 Thread Pavel Stehule
po 30. 11. 2020 v 22:56 odesílatel Pavel Stehule napsal: > > > po 30. 11. 2020 v 22:15 odesílatel Pavel Stehule > napsal: > >> >> >> po 30. 11. 2020 v 14:14 odesílatel Peter Eisentraut < >> peter.eisentr...@enterprisedb.com> napsal: >> >>> On 2020-11-29 18:36, Pavel Stehule wrote: >>> > >>> >

Re: proposal: unescape_text function

2020-11-30 Thread Pavel Stehule
po 30. 11. 2020 v 22:15 odesílatel Pavel Stehule napsal: > > > po 30. 11. 2020 v 14:14 odesílatel Peter Eisentraut < > peter.eisentr...@enterprisedb.com> napsal: > >> On 2020-11-29 18:36, Pavel Stehule wrote: >> > >> > I don't really get the point of this function. There is AFAICT no >> >

Re: proposal: unescape_text function

2020-11-30 Thread Pavel Stehule
po 30. 11. 2020 v 14:14 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > On 2020-11-29 18:36, Pavel Stehule wrote: > > > > I don't really get the point of this function. There is AFAICT no > > function to produce this escaped format, and it's not a recognized >

Re: proposal: unescape_text function

2020-11-30 Thread Peter Eisentraut
On 2020-11-29 18:36, Pavel Stehule wrote: I don't really get the point of this function.  There is AFAICT no function to produce this escaped format, and it's not a recognized interchange format.  So under what circumstances would one need to use this? Some corporate data can

Re: proposal: unescape_text function

2020-11-29 Thread Pavel Stehule
pá 27. 11. 2020 v 15:37 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > On 2020-10-07 11:00, Pavel Stehule wrote: > > Since the idea originated from unescaping unicode string > > literals i.e. > > select unescape('Odpov\u011Bdn\u00E1

Re: proposal: unescape_text function

2020-11-27 Thread Peter Eisentraut
On 2020-10-07 11:00, Pavel Stehule wrote: 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? good idea. The prefixes

Re: proposal: unescape_text function

2020-10-07 Thread Pavel Stehule
st 29. 7. 2020 v 8:18 odesílatel Pavel Stehule napsal: > Hi > > >> >> 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? >> > > good

Re: proposal: unescape_text function

2020-07-29 Thread Asif Rehman
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi, The patch looks good to me. The new status of this

Re: proposal: unescape_text function

2020-07-29 Thread Pavel Stehule
Hi > > 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? > good idea. The prefixes u (4 digits) and U (8 digits) are supported Regards

Re: proposal: unescape_text function

2020-07-28 Thread Asif Rehman
On Thu, Jul 2, 2020 at 10:10 PM Pavel Stehule wrote: > > > čt 2. 7. 2020 v 17:27 odesílatel Daniel Gustafsson > napsal: > >> > On 23 Jun 2020, at 11:51, Pavel Stehule >> wrote: >> >> > I changed the name to more accurately "unicode_unescape". Patch is >> assigned >> >> You've made this

Re: proposal: unescape_text function

2020-07-02 Thread Pavel Stehule
čt 2. 7. 2020 v 17:27 odesílatel Daniel Gustafsson napsal: > > On 23 Jun 2020, at 11:51, Pavel Stehule 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?

Re: proposal: unescape_text function

2020-07-02 Thread Daniel Gustafsson
> On 23 Jun 2020, at 11:51, Pavel Stehule 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

Re: proposal: unescape_text function

2020-06-23 Thread Pavel Stehule
po 22. 6. 2020 v 5:48 odesílatel Pavel Stehule napsal: > Hi > > There is one user request for unescape function in core. > > > https://stackoverflow.com/questions/20124393/convert-escaped-unicode-character-back-to-actual-character-in-postgresql/20125412?noredirect=1#comment110502526_20125412 > >

proposal: unescape_text function

2020-06-21 Thread Pavel Stehule
Hi There is one user request for unescape function in core. https://stackoverflow.com/questions/20124393/convert-escaped-unicode-character-back-to-actual-character-in-postgresql/20125412?noredirect=1#comment110502526_20125412 This request is about possibility that we do with string literal via