Table of Contents

Class NpgsqlDbColumn

Namespace
Npgsql.Schema
Assembly
Npgsql.dll

Provides schema information about a column.

public class NpgsqlDbColumn : DbColumn
Inheritance
NpgsqlDbColumn
Inherited Members

Remarks

Note that this can correspond to a field returned in a query which isn't an actual table column

See https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getschematable(v=vs.110).aspx for information on the meaning of the different fields.

Constructors

NpgsqlDbColumn()

Initializes a new instance of the NpgsqlDbColumn class.

public NpgsqlDbColumn()

Properties

AllowDBNull

Gets a nullable boolean value that indicates whether DBNull values are allowed in this column, or returns null if no value is set. Can be set to either true or false indicating whether DBNull values are allowed in this column, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? AllowDBNull { get; protected set; }

Property Value

bool?

Returns true if DBNull values are allowed in this column; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

BaseCatalogName

Gets the catalog name associated with the data source; otherwise, null if no value is set. Can be set to either the catalog name or null when overridden in a derived class.

public string BaseCatalogName { get; protected set; }

Property Value

string

The catalog name associated with the data source; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

BaseColumnName

Gets the base column name; otherwise, null if no value is set. Can be set to either the column name or null when overridden in a derived class.

public string? BaseColumnName { get; protected set; }

Property Value

string

The base column name; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

BaseSchemaName

Gets the schema name associated with the data source; otherwise, null if no value is set. Can be set to either the schema name or null when overridden in a derived class.

public string? BaseSchemaName { get; protected set; }

Property Value

string

The schema name associated with the data source; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

BaseServerName

Gets the server name associated with the column; otherwise, null if no value is set. Can be set to either the server name or null when overridden in a derived class.

public string BaseServerName { get; protected set; }

Property Value

string

The server name associated with the column; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

BaseTableName

Gets the table name in the schema; otherwise, null if no value is set. Can be set to either the table name or null when overridden in a derived class.

public string? BaseTableName { get; protected set; }

Property Value

string

The table name in the schema; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

ColumnAttributeNumber

The column's position within its table. Note that this is different from ColumnOrdinal, which is the column's position within the resultset.

public short? ColumnAttributeNumber { get; }

Property Value

short?

ColumnName

Gets the name of the column. Can be set to the column name when overridden in a derived class.

public string ColumnName { get; protected set; }

Property Value

string

The name of the column.

ColumnOrdinal

Gets the column position (ordinal) in the datasource row; otherwise, null if no value is set. Can be set to either an int32 value to specify the column position or null when overridden in a derived class.

public int? ColumnOrdinal { get; protected set; }

Property Value

int?

An int32 value for column ordinal; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

ColumnSize

Gets the column size; otherwise, null if no value is set. Can be set to either an int32 value to specify the column size or null when overridden in a derived class.

public int? ColumnSize { get; protected set; }

Property Value

int?

An int32 value for column size; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

DataType

Gets the type of data stored in the column. Can be set to a Type object that represents the type of data in the column when overridden in a derived class.

public Type? DataType { get; protected set; }

Property Value

Type

A Type object that represents the type of data the column contains.

DataTypeName

Gets the name of the data type; otherwise, null if no value is set. Can be set to either the data type name or null when overridden in a derived class.

public string DataTypeName { get; protected set; }

Property Value

string

The name of the data type; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

DefaultValue

The default SQL expression for this column.

public string? DefaultValue { get; }

Property Value

string

IsAliased

Gets a nullable boolean value that indicates whether this column is aliased, or returns null if no value is set. Can be set to either true or false indicating whether this column is aliased, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsAliased { get; protected set; }

Property Value

bool?

Returns true if this column is aliased; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsAutoIncrement

Gets a nullable boolean value that indicates whether values in this column are automatically incremented, or returns null if no value is set. Can be set to either true or false indicating whether values in this column are automatically incremented, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsAutoIncrement { get; protected set; }

Property Value

bool?

Returns true if values in this column are automatically incremented; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsIdentity

Gets a nullable boolean value that indicates whether this column is an identity, or returns null if no value is set. Can be set to either true or false indicating whether this column is an identity, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsIdentity { get; protected set; }

Property Value

bool?

Returns true if this column is an identity; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsKey

Gets a nullable boolean value that indicates whether this column is a key, or returns null if no value is set. Can be set to either true or false indicating whether this column is a key, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsKey { get; protected set; }

Property Value

bool?

Returns true if this column is a key; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsLong

Gets a nullable boolean value that indicates whether this column contains long data, or returns null if no value is set. Can be set to either true or false indicating whether this column contains long data, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsLong { get; protected set; }

Property Value

bool?

Returns true if this column contains long data; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsReadOnly

Gets a nullable boolean value that indicates whether this column is read-only, or returns null if no value is set. Can be set to either true or false indicating whether this column is read-only, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsReadOnly { get; protected set; }

Property Value

bool?

Returns true if this column is read-only; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

IsUnique

Gets a nullable boolean value that indicates whether a unique constraint applies to this column, or returns null if no value is set. Can be set to either true or false indicating whether a unique constraint applies to this column, or null (Nothing in Visual Basic) when overridden in a derived class.

public bool? IsUnique { get; protected set; }

Property Value

bool?

Returns true if a unique constraint applies to this column; otherwise, false. If no value is set, returns a null reference (Nothing in Visual Basic).

this[string]

Gets the object based on the column property name.

public override object? this[string propertyName] { get; }

Parameters

propertyName string

Property Value

object

The object based on the column property name.

NpgsqlDbType

The NpgsqlDbType value for this column's type.

public NpgsqlDbType? NpgsqlDbType { get; }

Property Value

NpgsqlDbType?

NumericPrecision

Gets the numeric precision of the column data; otherwise, null if no value is set. Can be set to either an int32 value to specify the numeric precision of the column data or null when overridden in a derived class.

public int? NumericPrecision { get; protected set; }

Property Value

int?

An int32 value that specifies the precision of the column data, if the data is numeric; otherwise, a null reference (Nothing in Visual Basic) if no value is set.

NumericScale

Gets a nullable int32 value that either returns null or the numeric scale of the column data. Can be set to either null or an int32 value for the numeric scale of the column data when overridden in a derived class.

public int? NumericScale { get; protected set; }

Property Value

int?

A null reference (Nothing in Visual Basic) if no value is set; otherwise, a int32 value that specifies the scale of the column data, if the data is numeric.

PostgresType

The PostgresType describing the type of this column.

public PostgresType PostgresType { get; }

Property Value

PostgresType

TableOID

The OID of the PostgreSQL table of this column.

public uint TableOID { get; }

Property Value

uint

TypeOID

The OID of the type of this column in the PostgreSQL pg_type catalog table.

public uint TypeOID { get; }

Property Value

uint

UdtAssemblyQualifiedName

Gets the assembly-qualified name of the Type object that represents the type of data in the column; otherwise, null if no value is set. Can be set to either the assembly-qualified name or null when overridden in a derived class.

public string? UdtAssemblyQualifiedName { get; protected set; }

Property Value

string

The assembly-qualified name of the Type object that represents the type of data in the column; otherwise, a null reference (Nothing in Visual Basic) if no value is set.