Method: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#get_database_version

Defined in:
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

#get_database_versionObject

Returns the version of the connected PostgreSQL server.



674
675
676
677
678
679
680
681
682
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 674

def get_database_version # :nodoc:
  with_raw_connection do |conn|
    version = conn.server_version
    if version == 0
      raise ActiveRecord::ConnectionNotEstablished, "Could not determine PostgreSQL version"
    end
    version
  end
end