Re: bug in localized \df+ output - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: bug in localized \df+ output
Date
Msg-id 20080514195145.GG9838@alvh.no-ip.org
Whole thread Raw
In response to bug in localized \df+ output  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: bug in localized \df+ output  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Alvaro Herrera wrote:
> I'm seeing this:
> 
> Liste des fonctions
> -[ RECORD 1 ]--------------------+----------------------------------------------------------------------------
> Schéma                          | public
> Nom                              | tg_backlink_a
> Type de données du résultat    | trigger
> Type de données des paramètres | 

After much poking around and talking to Bruce on IM I noticed that this
only shows up if the client is on a multibyte locale (I'm on an UTF8
locale) and the database has been created as SQL_ASCII.

So the environment is bogus: psql is calculating widths for locale C,
but psql is using the other locale.  Witness what happens when I run
psql in a non-UTF8 environment instead:

regression=# select * from baz;trouvé | détail | tròis 
--------+---------+--------f      | ááá  |      3
(1 fila)

(the alignment is correct, but the accented letter show up as UTF8
sequences interpreted as latin1)


And this is what I get on the UTF8 xterm:

regression=# select * from baz;trouv�| détail | tròis 
--------+---------+--------f      | ááá  |      3
(1 ligne)

(the accents are OK but the alignment is messed up).


So, in conclusion, the problem is that the environment is bogus, but I'm
not sure if something needs to be told to psql about that.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: What to do with inline warnings?
Next
From: "Marko Kreen"
Date:
Subject: [rfc,patch] PL/Proxy in core