This project is archived and is in readonly mode.
results of db:test:clone_structure do not get committed in postgres if the user has autocommit turned off
-
Juan Manuel Cuello
I tested the patch and it works OK with PostgreSQL 9.0.3.
But if --single-transaction was introduced in 8.2, I think would be better to check the server version before using the flag, maybe defining a new method in postgresql_adapter.rb to see if --single-transaction flag is supported, similar to 'supports_insert_with_returning?' method.
Something like:
def supports_single_transaction? postgresql_version >= 80200 endAnd then you can do:
single_transaction = '--single-transaction' if ActiveRecord::Base.connection.supports_single_transaction? `psql -U "#{abcs["test"]["username"]}" #{single_transaction} -f #{Rails.root}/db/#{Rails.env}_structure.sql {abcs["test"]["database"]} #{abcs["test"]["template"]}` -
Juan Manuel Cuello
But according to [35b2715456999662cc34390e258962738aaa8dc7], only pg >= 8.2 is supported, so there is no need to check the version.
