However, this error only propped up in my app after the rails 5 upgrade and the switch to this gem. Full Backtrace:
PG::SyntaxError: ERROR: syntax error at or near "DISCARD"
LINE 1: DISCARD ALL
^
1
File "/usr/local/bundle/gems/activerecord5-redshift-adapter-0.0.1/lib/active_record/connection_adapters/redshift_adapter.rb" line 238 in exec
2
File "/usr/local/bundle/gems/activerecord5-redshift-adapter-0.0.1/lib/active_record/connection_adapters/redshift_adapter.rb" line 238 in reset!
3
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 565 in block (2 levels) in reap
4
File "/usr/local/lib/ruby/2.3.0/monitor.rb" line 214 in mon_synchronize
5
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 563 in block in reap
6
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 562 in each
7
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 562 in reap
8
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 708 in acquire_connection
9
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 501 in checkout
10
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 364 in connection
11
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb" line 875 in retrieve_connection
12
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_handling.rb" line 128 in retrieve_connection
13
File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_handling.rb" line 91 in connection
A similar issue can be found in the activerecord4 adapter: https://github.com/aamine/activerecord4-redshift-adapter/issues/25 and there's an open PR to fix it: https://github.com/aamine/activerecord4-redshift-adapter/pull/26.
However, this error only propped up in my app after the rails 5 upgrade and the switch to this gem. Full Backtrace: