Re: Why format() adds double quote? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Why format() adds double quote?
Date
Msg-id CAFj8pRA-oLconoJ5V0ZPTrHyWAyw2bEvusXArgdrvnzxGz=vcw@mail.gmail.com
Whole thread Raw
In response to Re: Why format() adds double quote?  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: Why format() adds double quote?
List pgsql-hackers


2016-01-26 21:00 GMT+01:00 Daniel Verite <daniel@manitou-mail.org>:
        Tatsuo Ishii wrote:

> IMO, it's a bug or at least an inconsistency

Personally I don't see this change being good for everything.

Let's play devil's advocate:

create table abc(U&"foo\2003" int);

U+2003 is 'EM SPACE', in Unicode's General Punctuation block.

With the current version, format('%I', attname) on this column is:
"foo "

With the patched version, it produces this:
foo 

So the visual hint that there are more characters at the end is lost.

I can agree, so current behave can be useful in some cases, but still it is bug (inconsistency) between PostgreSQL parser and PostgreSQL escaping functions.

Currently, any multibyte char can be unescaped identifier (only apostrophes are tested). We should to test white chars too.

Regards

Pavel
 

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Next
From: Josh Berkus
Date:
Subject: Code of Conduct plan