server/sqlutils.py
branchstable
changeset 9267 24d9b86dfa54
parent 8944 b167f039b6cb
child 9321 212869484c65
child 9334 ea12401c0a68
equal deleted inserted replaced
9266:e54171abd3ed 9267:24d9b86dfa54
   376 
   376 
   377 
   377 
   378 def init_postgres_connexion(cnx):
   378 def init_postgres_connexion(cnx):
   379     cnx.cursor().execute('SET TIME ZONE UTC')
   379     cnx.cursor().execute('SET TIME ZONE UTC')
   380     # commit is needed, else setting are lost if the connection is first
   380     # commit is needed, else setting are lost if the connection is first
   381     # rollbacked
   381     # rolled back
   382     cnx.commit()
   382     cnx.commit()
   383 
   383 
   384 postgres_hooks = SQL_CONNECT_HOOKS.setdefault('postgres', [])
   384 postgres_hooks = SQL_CONNECT_HOOKS.setdefault('postgres', [])
   385 postgres_hooks.append(init_postgres_connexion)
   385 postgres_hooks.append(init_postgres_connexion)