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 11:31:04 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Jul 01, 2010 at 11:16:12AM +0200, Hilbert, Sebastian wrote:

> Jim,
> 
> If you have a chance and still the en_CA local installed please report what
> 
> psql -l is reporting.

That'd be interesting.

> I wonder if there is a way to find out if en_CA is utf8

en_CA means:

        behave (sort characters, format dates) as people in
        Canada would assume

utf8 means:

        characters are encoded as utf8

The two are orthogonal.

So, what you mean is: find out whether the cluster encodes
characters as utf8.

We already do that in the bootstrapper:

                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')
                elif not (lc_ctype.endswith('.utf-8') or 
lc_ctype.endswith('.utf8')):
                        _log.error('LC_CTYPE does not end in .UTF-8 or .UTF8')
                        _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

If the encoding (closest locale setting is lc_ctype =
character type) does not match utf8 somehow we don't like
the cluster.

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]