unknown variable: "timezone"
PG::InternalError: ERROR: unknown variable: "timezone" (ActiveRecord::StatementInvalid) : SET SESSION timezone TO 'UTC'
This seems to be caused by the inherited-from pg code trying to set a variable named timezone on connection start, but cockroach calls this variable time zone
It looks like cockroach supports SET SESSION time zone 'UTC' but not SET SESSION timezone 'UTC'
The related lines in the postgres active_record adapter are here:
https://github.com/rails/rails/blob/ef73318e29666786feb00e9e9b3b49a771bb0b73/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L708-L728
I was able to get around this issue by disabling ActiveRecord's automatic timezone management.
Added in my application.rb file:
config.time_zone = 'UTC'
config.active_record.default_timezone = :local
config.active_record.time_zone_aware_attributes = false
Not ideal, but it keeps me moving until I figure a real patch.