diff --git a/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb b/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb
+++ b/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb
@@ -11,7 +11,8 @@ module ActiveRecord
       valid_conn_param_keys = PG::Connection.conndefaults_hash.keys + [:requiressl]
       conn_params.slice!(*valid_conn_param_keys)
 
-      ConnectionAdapters::OvirtPostgreSQLAdapter.new(nil, logger, conn_params, config)
+      conn = PG.connect(conn_params) if ActiveRecord::VERSION::MAJOR >= 6
+      ConnectionAdapters::OvirtPostgreSQLAdapter.new(conn, logger, conn_params, config)
     end
   end
 
@@ -27,4 +28,4 @@ module ActiveRecord
       end
     end
   end
-end
\ No newline at end of file
+end
Pass in a connection when initializing pg adapter

On ActiveRecord <I>+ the `ConnectionAdapters::PostgreSQLAdapter#initialize` expects to be passed in a valid postgres connection, where previous versions expected this to be `nil`.