Comment 4 for bug 947455

Revision history for this message
Stuart Bishop (stub) wrote :

But not in the latest release...

>>> import storm
>>> storm.version
'0.19'
>>> from storm.locals import *
>>> database = create_database('postgres:stub')
>>> store = Store(database)
>>> store.execute('select true').get_one()[0]
True
>>> store.execute('select pg_terminate_backend(pg_backend_pid())')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/store.py", line 108, in execute
    return self._connection.execute(statement, params, noresult)
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/databases/postgres.py", line 249, in execute
    return Connection.execute(self, statement, params, noresult)
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/database.py", line 238, in execute
    raw_cursor = self.raw_execute(statement, params)
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/databases/postgres.py", line 259, in raw_execute
    return Connection.raw_execute(self, statement, params)
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/database.py", line 322, in raw_execute
    self._check_disconnect(raw_cursor.execute, *args)
  File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/database.py", line 371, in _check_disconnect
    return function(*args, **kwargs)
psycopg2.OperationalError: terminating connection due to administrator command
FATAL: terminating connection due to administrator command