gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Postgres 8.4.4-1 (Enterprise db) problems -- system h


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Postgres 8.4.4-1 (Enterprise db) problems -- system hosed?
Date: Thu, 1 Jul 2010 12:29:45 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Jul 01, 2010 at 02:26:12AM -0700, Jim Busser wrote:

> Retaining the files in /data will cause the installer to deny the user the 
> option to choose anew the needed locale. Ironically, what is needed is simply 
> [Default locale].
> 
> en_CA
>       --> client_encoding = UNICODE (I think)

That should'a worked as well, maybe we can improve the test
as Sebastian suggested:

                # verify encoding
                curs = self.conn.cursor()
                curs.execute(u"select setting from pg_settings where name = 
'lc_ctype'")
                data = curs.fetchall()
                lc_ctype = data[0][0]
                _log.info('template database LC_CTYPE is [%s]', lc_ctype)
                lc_ctype = lc_ctype.lower()
                if lc_ctype in ['c', 'posix']:
                        _log.warning('while this cluster setting allows to 
store databases')
                        _log.warning('in any encoding as is it does not allow 
for locale')
                        _log.warning('sorting etc, hence it is not recommended 
for use')
                        _log.warning('(although it will, technically, work)')
                elif not (lc_ctype.endswith('.utf-8') or 
lc_ctype.endswith('.utf8')):
                        _log.error('LC_CTYPE does not end in .UTF-8 or .UTF8')
                        curs.execute(u"show server_encoding")
                        data = curs.fetchall()
                        srv_enc = data[0][0]
                        _log.info('server_encoding is [%s]', srv_enc)
                        srv_enc = srv_enc.lower()
                        if not srv_enc in ['utf8', 'utf-8']:
                                _log.error('cluster encoding incompatible with 
utf8 encoded databases but')
                                _log.error('for GNUmed installation the cluster 
must accept this encoding')
                                _log.error('you may need to re-initdb or create 
a new cluster')
                                return None
                        _log.info('server encoding seems compatible despite not 
being reported in LC_CTYPE')

> C
>       --> client_encoding = SQL_ASCII (apparently)

This would not be useful.

> [Default locale]
> 
>       --> locale = "C", client_encoding = UTF8 (apparently)

Good.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]