Re: UTF-8 encoding problem w/ libpq - Mailing list pgsql-hackers

From ktm@rice.edu
Subject Re: UTF-8 encoding problem w/ libpq
Date
Msg-id 20130603152751.GH2892@aart.rice.edu
Whole thread Raw
In response to Re: UTF-8 encoding problem w/ libpq  (Martin Schäfer <Martin.Schaefer@cadcorp.com>)
Responses Re: UTF-8 encoding problem w/ libpq
List pgsql-hackers
On Mon, Jun 03, 2013 at 04:09:29PM +0100, Martin Schäfer wrote:
> 
> > > If I change the strCreate query and add double quotes around the column
> > name, then the problem disappears. But the original name is already in
> > lowercase, so I think it should also work without quoting the column name.
> > > Am I missing some setup in either the database or in the use of libpq?
> > >
> > > I’m using PostgreSQL 9.2.1, compiled by Visual C++ build 1600, 64-bit
> > >
> > > The database uses:
> > > ENCODING = 'UTF8'
> > > LC_COLLATE = 'English_United Kingdom.1252'
> > > LC_CTYPE = 'English_United Kingdom.1252'
> > >
> > > Thanks for any help,
> > >
> > > Martin
> > >
> > 
> > Hi Martin,
> > 
> > If you do not want the lowercase behavior, you must put double-quotes
> > around the column name per the documentation:
> > 
> > http://www.postgresql.org/docs/9.2/interactive/sql-syntax-
> > lexical.html#SQL-SYNTAX-IDENTIFIERS
> > 
> > section 4.1.1.
> > 
> > Regards,
> > Ken
> 
> The original name 'id_äß' is already in lowercase. The backend should leave it unchanged IMO.
> 
> Regards,
> Martin
> 

Only in utf-8 which needs to be double-quoted for a column name as you have
seen, otherwise the value will be lowercased per byte.

Regards,
Ken



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Running pgindent
Next
From: Dave Page
Date:
Subject: Re: Implicit rule created for materialized views