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: Jim Busser
Subject: Re: [Gnumed-devel] Postgres 8.4.4-1 (Enterprise db) problems -- system hosed?
Date: Sun, 04 Jul 2010 21:45:06 -0700

re using the new bootstrap code

On 2010-07-01, at 1:17 PM, Sebastian Hilbert wrote:

> It already is as per Karsten's posting
> ...
> http://gitorious.org/gnumed/gnumed/commit/e793017a2ff8ee5ec5c2c58d576fab2d1e0a607c

If I download from source (master) the bootstrap.latest offers in the file
        bootstrap_gm_db_system.py

the following new code but it is for database v14... So would it be better on 
Mac to first see if we (I) can get up v13 instead of starting out trying v14?

If yes, then to bootstrap (on Mac) v13, can I simply substitute in the v13 
server tarball
        bootstrap_gm_db_system.py

******************************************
new code

                # 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')

        #--------------------------------------------------------------

in place of old  v13.x bootstrap code

                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
                # make sure we get english messages
                curs.execute(u"set lc_messages to 'C'")
                curs.close()

                _log.info("successfully connected to template database [%s]" % 
self.template_db)
                return True
        #--------------------------------------------------------------


reply via email to

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