Table of Contents

Class PostgresType

Namespace
Npgsql.PostgresTypes
Assembly
Npgsql.dll

Represents a PostgreSQL data type, such as int4 or text, as discovered from pg_type. This class is abstract, see derived classes for concrete types of PostgreSQL types.

public abstract class PostgresType
Inheritance
PostgresType
Derived
Inherited Members

Remarks

Instances of this class are shared between connections to the same databases. For more info about what this class and its subclasses represent, see https://www.postgresql.org/docs/current/static/catalog-pg-type.html.

Properties

Array

If a PostgreSQL array type exists for this type, it will be referenced here. Otherwise null.

public PostgresArrayType? Array { get; }

Property Value

PostgresArrayType

DisplayName

A display name for this backend type, including the namespace unless it is pg_catalog (the namespace for all built-in types).

public string DisplayName { get; }

Property Value

string

FullName

The full name of the backend type, including its namespace.

public string FullName { get; }

Property Value

string

InternalName

The data type's internal PostgreSQL name (e.g. _int4 not integer[]). See Name for a more user-friendly name.

public string InternalName { get; }

Property Value

string

Name

The data type's name.

public string Name { get; }

Property Value

string

Remarks

Note that this is the standard, user-displayable type name (e.g. integer[]) rather than the internal PostgreSQL name as it is in pg_type (_int4). See InternalName for the latter.

Namespace

The data type's namespace (or schema).

public string Namespace { get; }

Property Value

string

OID

The data type's OID - a unique id identifying the data type in a given database (in pg_type).

public uint OID { get; }

Property Value

uint

Range

If a PostgreSQL range type exists for this type, it will be referenced here. Otherwise null.

public PostgresRangeType? Range { get; }

Property Value

PostgresRangeType

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string