Changeset 2960

Show
Ignore:
Timestamp:
06/27/06 23:43:52 (18 years ago)
Author:
jerome
Message:

Fixed a database client encoding problem : if the database already
exists and its encoding is not compatible with UTF-8 client encoding
(for example MULE_INTERNAL), an error occured in the SET CLIENT_ENCODING query.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/pgstorage.py

    r2954 r2960  
    5454        self.database = pg.connect(host=host, port=port, dbname=dbname, user=user, passwd=passwd) 
    5555        self.closed = 0 
    56         self.database.query("SET CLIENT_ENCODING TO 'UTF-8';") 
     56        try : 
     57            self.database.query("SET CLIENT_ENCODING TO 'UTF-8';") 
     58        except PGError, msg :     
     59            self.tool.printInfo("Impossible to set database client encoding to UTF-8 : %s" % msg, "error") 
    5760        self.tool.logdebug("Database opened (host=%s, port=%s, dbname=%s, user=%s)" % (host, port, dbname, user)) 
    5861