543 |
543 |
544 def __init__(self, config): |
544 def __init__(self, config): |
545 super(PostgresTestDataBaseHandler, self).__init__(config) |
545 super(PostgresTestDataBaseHandler, self).__init__(config) |
546 datadir = join(self.config.apphome, 'pgdb') |
546 datadir = join(self.config.apphome, 'pgdb') |
547 if not exists(datadir): |
547 if not exists(datadir): |
548 subprocess.check_call(['initdb', '-D', datadir, '-E', 'utf-8']) |
548 subprocess.check_call(['initdb', '-D', datadir, '-E', 'utf-8', '--locale=C']) |
549 port = self.system_source['db-port'] |
549 port = self.system_source['db-port'] |
550 subprocess.check_call(['pg_ctl', 'start', '-w', '-D', datadir, '-o', '-h "" -k /tmp -p %s' % port]) |
550 subprocess.check_call(['pg_ctl', 'start', '-w', '-D', datadir, '-o', '-h "" -k /tmp -p %s' % port]) |
551 self.__CTL.add(datadir) |
551 self.__CTL.add(datadir) |
552 |
552 |
553 @property |
553 @property |