    # File lib/active_record/connection_adapters/postgresql_adapter.rb, line 797
            def postgresql_version
              @postgresql_version ||=
                if @connection.respond_to?(:server_version)
                  @connection.server_version
                else
                  # Mimic PGconn.server_version behavior
                  begin
                    query('SELECT version()')[0][0] =~ /PostgreSQL (\d+)\.(\d+)\.(\d+)/
                    ($1.to_i * 10000) + ($2.to_i * 100) + $3.to_i
                  rescue
                    0
                  end
                end
            end