# Class NpgsqlDatabaseInfo

Namespace
  Npgsql.Internal

Assembly
  Npgsql.dll

Base class for implementations which provide information about PostgreSQL and PostgreSQL-like databases (e.g. type definitions, capabilities...).

    public abstract class NpgsqlDatabaseInfo

Inheritance
  object
  NpgsqlDatabaseInfo

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### NpgsqlDatabaseInfo(string, int, string, Version)

Initializes the instance of NpgsqlDatabaseInfo.

    protected NpgsqlDatabaseInfo(string host, int port, string databaseName, Version version)

#### Parameters

`host` string
`port` int
`databaseName` string
`version` Version

### NpgsqlDatabaseInfo(string, int, string, Version, string)

Initializes the instance of NpgsqlDatabaseInfo.

    protected NpgsqlDatabaseInfo(string host, int port, string databaseName, Version version, string serverVersion)

#### Parameters

`host` string
`port` int
`databaseName` string
`version` Version
`serverVersion` string

## Properties

### HasIntegerDateTimes

Reports whether the backend uses the newer integer timestamp representation.

    public virtual bool HasIntegerDateTimes { get; protected set; }

#### Property Value

bool

### Host

The hostname of IP address of the database.

    public string Host { get; }

#### Property Value

string

### Name

The database name.

    public string Name { get; }

#### Property Value

string

### Port

The TCP port of the database.

    public int Port { get; }

#### Property Value

int

### ServerVersion

The PostgreSQL version string as returned by the server_version option. Populated during loading.

    public string ServerVersion { get; }

#### Property Value

string

### SupportsAdvisoryLocks

Whether the backend supports advisory locks.

    public virtual bool SupportsAdvisoryLocks { get; }

#### Property Value

bool

### SupportsCloseAll

Whether the backend supports the CLOSE ALL statement.

    public virtual bool SupportsCloseAll { get; }

#### Property Value

bool

### SupportsDiscard

Whether the backend supports the DISCARD statement.

    public virtual bool SupportsDiscard { get; }

#### Property Value

bool

### SupportsDiscardSequences

Whether the backend supports the DISCARD SEQUENCES statement.

    public virtual bool SupportsDiscardSequences { get; }

#### Property Value

bool

### SupportsDiscardTemp

Whether the backend supports the DISCARD TEMP statement.

    public virtual bool SupportsDiscardTemp { get; }

#### Property Value

bool

### SupportsEnumTypes

Whether the backend supports enum types.

    public virtual bool SupportsEnumTypes { get; }

#### Property Value

bool

### SupportsMultirangeTypes

Whether the backend supports multirange types.

    public virtual bool SupportsMultirangeTypes { get; }

#### Property Value

bool

### SupportsRangeTypes

Whether the backend supports range types.

    public virtual bool SupportsRangeTypes { get; }

#### Property Value

bool

### SupportsTransactions

Whether the database supports transactions.

    public virtual bool SupportsTransactions { get; protected set; }

#### Property Value

bool

### SupportsUnlisten

Whether the backend supports the UNLISTEN statement.

    public virtual bool SupportsUnlisten { get; }

#### Property Value

bool

### Version

The version of the PostgreSQL database we're connected to, as reported in the "server_version" parameter. Exposed via PostgreSqlVersion.

    public Version Version { get; }

#### Property Value

Version

## Methods

### GetPostgresType(string)

    public PostgresType GetPostgresType(string pgName)

#### Parameters

`pgName` string

#### Returns

PostgresType

### GetPostgresType(uint)

    public PostgresType GetPostgresType(uint oid)

#### Parameters

`oid` uint

#### Returns

PostgresType

### GetTypes()

Provides all PostgreSQL types detected in this database.

    protected abstract IEnumerable<PostgresType> GetTypes()

#### Returns

IEnumerable<PostgresType>

### ParseServerVersion(string)

Parses a PostgreSQL server version (e.g. 10.1, 9.6.3) and returns a CLR Version.

    protected static Version ParseServerVersion(string value)

#### Parameters

`value` string

#### Returns

Version

### RegisterFactory(INpgsqlDatabaseInfoFactory)

Registers a new database info factory, which is used to load information about databases.

    public static void RegisterFactory(INpgsqlDatabaseInfoFactory factory)

#### Parameters

`factory` INpgsqlDatabaseInfoFactory

### TryGetPostgresTypeByName(string, out PostgresType?)

    public bool TryGetPostgresTypeByName(string pgName, out PostgresType? pgType)

#### Parameters

`pgName` string
`pgType` PostgresType

#### Returns

bool