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

From Dickson S. Guedes
Subject Re: Why format() adds double quote?
Date
Msg-id CAHHcrepPun4=-cVJc9cZQtuw0mP6-kKAbfT_+bU3LZkw2t-hvA@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?  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-hackers
2016-01-26 18:00 GMT-02:00 Daniel Verite <daniel@manitou-mail.org>:
> ...
> 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.


Thanks for advocate, I see here that it even produces that output with
simple spaces.

postgres=# create table x ("aí      " text);
CREATE TABLE
postgres=# \d x       Tabela "public.x" Coluna  | Tipo | Modificadores
----------+------+---------------aí       | text |


This will break copy&paste user actions and scripts that parses that output.

Maybe the patch should consider left/right non-printable chars to
choose whether to show or not the " ?

[]s
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://github.com/guedes - http://guedesoft.net
http://www.postgresql.org.br



pgsql-hackers by date:

Previous
From: "Dickson S. Guedes"
Date:
Subject: Re: Why format() adds double quote?
Next
From: Alvaro Herrera
Date:
Subject: Re: pgbench stats per script & other stuff