Search Postgresql Archives

Re: PostgreSQL 9.0.3 - collate/ctype order by hu_HU.UTF8 is not correct sorting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/2/5 Adam PAPAI <adam.papai@xxxxxxxxxxxxxxxxxxxx>:
> Pavel Stehule wrote:
>> Hello
>>
>> You should to initialize database with correct locale. You can't to
>> change locale after database is created.
>>
>> /usr/local/pgsql91/bin/createdb test --locale=cs_CZ.utf-8 -e UTF-8
>> CREATE DATABASE test LC_COLLATE 'cs_CZ.utf-8' LC_CTYPE 'cs_CZ.utf-8';
>> COMMENT ON DATABASE test IS 'UTF-8';
>>
>> test=# show lc_collate ;
>> Âlc_collate
>> -------------
>> Âcs_CZ.utf-8
>> (1 row)
>>
>> test=# select * from (values('SÃs'),('ÅiÅka'),('SyrovÃ'),('Vondra')) x
>> ORDER BY 1;
>> Âcolumn1
>> ---------
>> ÂSÃs
>> ÂSyrovÃ
>> ÂÅiÅka
>> ÂVondra
>> (4 rows)
>>
>> Regards
>>
>> Pavel Stehule
>>
>
> Something is not correct for me.
>
> I've re-initialised it again with:
>
> --locale=hu_HU.UTF-8 --encoding=UTF-8
>
> which generated everything LC_* to hu_HU.UTF-8.
>
> I've created the DBs with createdb:
>
> createdb -U pgsql "$DBNAME" -E "UTF-8" --locale="hu_HU.UTF-8"
>
> Example:
>
> createdb -U pgsql spiritnet -E UTF-8 --locale=hu_HU.UTF-8
>
> spiritnet=# show lc_collate;
> Âlc_collate
> -------------
> Âhu_HU.UTF-8
> (1 row)
>
> spiritnet=# show lc_ctype;
> Âlc_ctype
> -------------
> Âhu_HU.UTF-8
>
>     Name     Â| Owner | Encoding Â| ÂCollation Â|  ÂCtype
> -----------------------+-------+-----------+-------------+-------------
> Âspiritnet       | pgsql | UTF8   Â| hu_HU.UTF-8 | hu_HU.UTF-8
>
>
> And it STILL NOT working, the order by is absolutly incorrect. All chars
> with accents, are located at the END of the list. Is it a problem only
> with 9.0.3?
>
>
> For me, your test shows:
>
> "SyrovÃ"
> "SÃs"
> "Vondra"
> "ÅiÅka"
>
> instead your correct order.
>
> Any ideas?


your system locales is correct? PostgreSQL uses only system libs

Regards

Pavel Stehule
>
> Further information:
>
> [root@radon /usr/local/pgsql]# pg_config
> BINDIR = /usr/local/bin
> DOCDIR = /usr/local/share/doc/postgresql
> HTMLDIR = /usr/local/share/doc/postgresql
> INCLUDEDIR = /usr/local/include
> PKGINCLUDEDIR = /usr/local/include/postgresql
> INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
> LIBDIR = /usr/local/lib
> PKGLIBDIR = /usr/local/lib/postgresql
> LOCALEDIR = /usr/local/share/locale
> MANDIR = /usr/local/man
> SHAREDIR = /usr/local/share/postgresql
> SYSCONFDIR = /usr/local/etc/postgresql
> PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
> CONFIGURE = '--with-libraries=/usr/local/lib'
> '--with-includes=/usr/local/include' '--enable-thread-safety'
> '--with-openssl' '--with-libxml' '--enable-nls' '--with-gssapi'
> '--prefix=/usr/local' '--mandir=/usr/local/man'
> '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.1'
> 'build_alias=amd64-portbld-freebsd8.1' 'CC=cc' 'CFLAGS=-O2 -pipe -O3
> -funroll-loops -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib
> -rpath=/usr/lib:/usr/local/lib' 'CPP=cpp'
> CC = cc
> CPPFLAGS = -I/usr/local/include/libxml2 -I/usr/local/include
> -I/usr/local/include -I/usr/local/include
> CFLAGS = -O2 -pipe -O3 -funroll-loops -fno-strict-aliasing -Wall
> -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
> -Wendif-labels -fno-strict-aliasing -fwrapv
> CFLAGS_SL = -fPIC -DPIC
> LDFLAGS = -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib
> -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -Wl,--as-needed
> -Wl,-R'/usr/local/lib'
> LDFLAGS_EX =
> LDFLAGS_SL =
> LIBS = -lpgport -lintl -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz
> -lreadline -lcrypt -lm
> VERSION = PostgreSQL 9.0.3
>
>
> [root@radon /usr/local/pgsql]# pg_controldata /usr/local/pgsql/data
> pg_control version number: Â Â Â Â Â Â903
> Catalog version number: Â Â Â Â Â Â Â 201008051
> Database system identifier: Â Â Â Â Â 5570316617043000695
> Database cluster state: Â Â Â Â Â Â Â in production
> pg_control last modified: Â Â Â Â Â Â Sat Feb Â5 22:58:43 2011
> Latest checkpoint location: Â Â Â Â Â 0/9008D748
> Prior checkpoint location: Â Â Â Â Â Â0/8FF99F68
> Latest checkpoint's REDO location: Â Â0/9005FEB0
> Latest checkpoint's TimeLineID: Â Â Â 1
> Latest checkpoint's NextXID: Â Â Â Â Â0/16405
> Latest checkpoint's NextOID: Â Â Â Â Â57344
> Latest checkpoint's NextMultiXactId: Â1
> Latest checkpoint's NextMultiOffset: Â0
> Latest checkpoint's oldestXID: Â Â Â Â654
> Latest checkpoint's oldestXID's DB: Â 1
> Latest checkpoint's oldestActiveXID: Â0
> Time of latest checkpoint: Â Â Â Â Â ÂSat Feb Â5 22:58:33 2011
> Minimum recovery ending location: Â Â 0/0
> Backup start location: Â Â Â Â Â Â Â Â0/0
> Current wal_level setting: Â Â Â Â Â Âminimal
> Current max_connections setting: Â Â Â40
> Current max_prepared_xacts setting: Â 0
> Current max_locks_per_xact setting: Â 64
> Maximum data alignment: Â Â Â Â Â Â Â 8
> Database block size: Â Â Â Â Â Â Â Â Â8192
> Blocks per segment of large relation: 131072
> WAL block size: Â Â Â Â Â Â Â Â Â Â Â 8192
> Bytes per WAL segment: Â Â Â Â Â Â Â Â16777216
> Maximum length of identifiers: Â Â Â Â64
> Maximum columns in an index: Â Â Â Â Â32
> Maximum size of a TOAST chunk: Â Â Â Â1996
> Date/time type storage: Â Â Â Â Â Â Â 64-bit integers
> Float4 argument passing: Â Â Â Â Â Â Âby value
> Float8 argument passing: Â Â Â Â Â Â Âby value
>
>
> --
> Adam PAPAI
> BSD Support Service
> http://www.bsdsupportservice.hu
> E-mail: adam.papai@xxxxxxxxxxxxxxxxxxxx
> Phone: +36 30 33-55-735 (Hungary)
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux