Skip to content

Commit

Permalink
Fix create for libpq 9.6 and older db (#418)
Browse files Browse the repository at this point in the history
When Postgres library (libpq) 9.6 is installed on the server, `pg_dump` adds an SQL command to SET `idle_in_transaction_session_timeout`, which is new to 9.6, so it fails when running against older versions of the Postgres database.

I've added the parameter to the blacklist.
  • Loading branch information
omergertel authored and mikecmpbll committed Jul 19, 2017
1 parent eafb3ef commit 163961b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/apartment/adapters/postgresql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class PostgresqlSchemaFromSqlAdapter < PostgresqlSchemaAdapter

PSQL_DUMP_BLACKLISTED_STATEMENTS= [
/SET search_path/i, # overridden later
/SET lock_timeout/i # new in postgresql 9.3
/SET lock_timeout/i, # new in postgresql 9.3
/SET idle_in_transaction_session_timeout/i, # new in postgresql 9.6
]

def import_database_schema
Expand Down

0 comments on commit 163961b

Please sign in to comment.