server/sqlutils.py
changeset 7229 a60522259c2c
parent 7221 dc79f1a3c6ed
child 7341 c419c2d0d13e
equal deleted inserted replaced
7228:9d04e12d2d39 7229:a60522259c2c
   333 sqlite_hooks.append(init_sqlite_connexion)
   333 sqlite_hooks.append(init_sqlite_connexion)
   334 
   334 
   335 
   335 
   336 def init_postgres_connexion(cnx):
   336 def init_postgres_connexion(cnx):
   337     cnx.cursor().execute('SET TIME ZONE UTC')
   337     cnx.cursor().execute('SET TIME ZONE UTC')
       
   338     # commit is needed, else setting are lost if the connection is first
       
   339     # rollbacked
       
   340     cnx.commit()
   338 
   341 
   339 postgres_hooks = SQL_CONNECT_HOOKS.setdefault('postgres', [])
   342 postgres_hooks = SQL_CONNECT_HOOKS.setdefault('postgres', [])
   340 postgres_hooks.append(init_postgres_connexion)
   343 postgres_hooks.append(init_postgres_connexion)