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: Sebastian Hilbert
Subject: Re: [Gnumed-devel] Postgres 8.4.4-1 (Enterprise db) problems -- system hosed?
Date: Thu, 1 Jul 2010 12:51:23 +0200
User-agent: KMail/1.13.3 (Linux/2.6.33-6-desktop; KDE/4.4.3; i686; ; )

Am Donnerstag 01 Juli 2010, 12:29:45 schrieb Karsten Hilbert:
> 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')

Excellent stuff. This could even work on Windows.

Sebastian



reply via email to

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