I’m using PosgreSQL adapter to connect to Vertica database which is mostly compatible with PostgreSQL but doesn’t support options like client_min_messages (which are still passed to PGconn.connect despite not being present in database.yml). I’ve made a quick and dirty monkey patch for ActiveRecord::ConnectionAdapters::PostgreSQLAdapter but the problem is that I guess everything in AR in lazy loaded and the original file is read after my patch.
If I add require 'active_record/connection_adapters/postgresql_adapter' at the top of the monkey patch then ActiveRecord tries to establish connection and fails. Is it possible to alter this behavior to make the monkey patch work or should I just write a full-fledged connection adapter?
You can hook your code to railties initialization. Including sample from my gem multi_config: