fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

PostgreSQL 10 compatibility #65

Closed gtors closed 6 years ago

gtors commented 6 years ago

On stellar snapshot s_2017_11:

Traceback (most recent call last):
  File "/usr/bin/stellar", line 11, in <module>
    load_entry_point('stellar==0.4.3', 'console_scripts', 'stellar')()
  File "/usr/lib/python2.7/site-packages/stellar/command.py", line 279, in main
    stellar()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/stellar/command.py", line 70, in snapshot
    app.create_snapshot(name, before_copy=before_copy)
  File "/usr/lib/python2.7/site-packages/stellar/app.py", line 120, in create_snapshot
    table.get_table_name('master')
  File "/usr/lib/python2.7/site-packages/stellar/operations.py", line 56, in copy_database
    terminate_database_connections(raw_conn, from_database)
  File "/usr/lib/python2.7/site-packages/stellar/operations.py", line 40, in terminate_database_connections
    ''' % {'pid_column': pid_column, 'database': database}
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 939, in execute
    return self._execute_text(object, multiparams, params)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1097, in _execute_text
    statement, parameters
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column pg_stat_activity.procpid does not exist
LINE 2:                 SELECT pg_terminate_backend(pg_stat_activity...

stellar == 0.4.3 psycopg2 == 2.7.3.2 SQLAlchemy == 1.1.15

gtors commented 6 years ago

Fixed in https://github.com/fastmonkeys/stellar/pull/63, but new version is not published yet

So, I fixed this by: pip install -U git+https://github.com/fastmonkeys/stellar#egg=stellar==0.4.3