Npgsql Note that this message doesn't actually contain the data, but only the length. Data is processed directly from the connector's buffer. Note: This message is both a frontend and a backend message The number of columns in the current row The index of the column that we're on, i.e. that has already been parsed, is is memory and can be retrieved. Initialized to -1 For streaming types (e.g. bytea, text), holds the current byte position within the column. Does not include the length prefix. For streaming types (e.g. bytea), holds the byte length of the column. Does not include the length prefix. Places our position at the beginning of the given column, after the 4-byte length. The length is available in ColumnLen. Returns a stream for the current column. Consumes the current row, allowing the reader to read in the next one. List of all streams that have been opened on this row, and need to be disposed of when the row is consumed. A stream that has been opened on this colun, and needs to be disposed of when the column is consumed. Places our position at the beginning of the given column, after the 4-byte length. The length is available in ColumnLen. Error and notice message field codes A RowDescription message sent from the backend. See http://www.postgresql.org/docs/current/static/protocol-message-formats.html Given a string name, returns the field's ordinal index in the row. Given a string name, returns the field's ordinal index in the row. A descriptive record on a single field received from PostgreSQL. See RowDescription in http://www.postgresql.org/docs/current/static/protocol-message-formats.html The field name. The object ID of the field's data type. The data type size (see pg_type.typlen). Note that negative values denote variable-width types. The type modifier (see pg_attribute.atttypmod). The meaning of the modifier is type-specific. If the field can be identified as a column of a specific table, the object ID of the table; otherwise zero. If the field can be identified as a column of a specific table, the attribute number of the column; otherwise zero. The format code being used for the field. Currently will be zero (text) or one (binary). In a RowDescription returned from the statement variant of Describe, the format code is not yet known and will always be zero. The Npgsql type handler assigned to handle this field. Returns for fields with format text. The type handler resolved for this field, regardless of whether it's binary or text. Base class for all classes which represent a message sent by the PostgreSQL backend. Base class for all classes which represent a message sent to the PostgreSQL backend. Concrete classes which directly inherit this represent arbitrary-length messages which can chunked. the buffer into which to write the message. Whether there was enough space in the buffer to contain the entire message. If false, the buffer should be flushed and write should be called again. Returns how many messages PostgreSQL is expected to send in response to this message. Used for message prepending. Represents a simple frontend message which is typically small and fits well within the write buffer. The message is first queries for the number of bytes it requires, and then writes itself out. Returns the number of bytes needed to write this message. Writes the message contents into the buffer. Specifies the type of SQL statement, e.g. SELECT The way how to order bytes. Most significant byte first (XDR) Less significant byte first (NDR) The number of connections per second that are being made to a database server. The number of disconnects per second that are being made to a database server. The total number of connection pools. The number of (pooled) active connections that are currently in use. The number of connections available for use in the connection pools. The number of active connections that are not pooled. The number of active connections that are being managed by the connection pooling infrastructure. The number of active connections being pulled from the connection pool. The number of active connections that are being returned to the connection pool. This class is currently a simple wrapper around System.Diagnostics.PerformanceCounter. Since these aren't supported in netstandard13, all the ifdef'ing happens here. When an alternative performance counter API emerges for netstandard, it can be added here. The name of the destination portal (an empty string selects the unnamed portal). The name of the source prepared statement (an empty string selects the unnamed prepared statement). The name of the prepared statement or portal to close (an empty string selects the unnamed prepared statement or portal). Whether to close a statement or a portal The name of the prepared statement or portal to describe (an empty string selects the unnamed prepared statement or portal). Whether to describe a statement or a portal The query string to be parsed. The name of the destination prepared statement (an empty string selects the unnamed prepared statement). Creates an MD5 password message. This is the password, hashed with the username as salt, and hashed again with the backend-provided salt. A frontend message of an arbitrary type that has been pregenerated for efficiency - it is kept in byte[] form and doesn't have to be serialized for each send. Constructs a new pregenerated message. The data to be sent for this message, not including the 4-byte length. Optional string form/description for debugging Returns how many messages PostgreSQL is expected to send in response to this message. A simple query message. Launches MIT Kerberos klist and parses out the default principal from it. Caches the result. An array of cached lengths for the parameters sending process. When sending parameters, lengths need to be calculated more than once (once for Bind, once for an array, once for the string within that array). This cache optimized that. Lengths are added to the cache, and then retrieved at the same order. An logging provider that outputs Npgsql logging messages to standard error. Constructs a new Only messages of this level of higher will be logged If true, will output the log level (e.g. WARN). Defaults to false. If true, will output the connector ID. Defaults to false. Creates a new instance of the given name. Used to create logger instances of the given name. Creates a new INpgsqlLogger instance of the given name. A generic interface for logging. Manages logging for Npgsql, used to set the loggging provider. The logging provider used for logging in Npgsql. Determines whether parameter contents will be logged alongside SQL statements - this may reveal sensitive information. Defaults to false. A component which translates a CLR name (e.g. SomeClass) into a database name (e.g. some_class) according to some scheme. Used for mapping enum and composite types. Given a CLR type name (e.g class, struct, enum), translates its name to a database type name. Given a CLR member name (property or field), translates its name to a database type name. A name translator which preserves CLR names (e.g. SomeClass) when mapping names to the database. Given a CLR type name (e.g class, struct, enum), translates its name to a database type name. Given a CLR member name (property or field), translates its name to a database type name. A name translator which converts standard CLR names (e.g. SomeClass) to snake-case database names (some_class) Given a CLR type name (e.g class, struct, enum), translates its name to a database type name. Given a CLR member name (property or field), translates its name to a database type name. Provides an API for a binary COPY TO operation, a high-performance data export mechanism from a PostgreSQL table. Initiated by The number of columns, as returned from the backend in the CopyInResponse. Starts reading a single row, must be invoked before reading any columns. The number of columns in the row. -1 if there are no further rows. Note: This will currently be the same value for all rows, but this may change in the future. Reads the current column, returns its value and moves ahead to the next column. If the column is null an exception is thrown. The type of the column to be read. This must correspond to the actual type or data corruption will occur. If in doubt, use to manually specify the type. The value of the column Reads the current column, returns its value according to and moves ahead to the next column. If the column is null an exception is thrown. In some cases isn't enough to infer the data type coming in from the database. This parameter and be used to unambiguously specify the type. An example is the JSONB type, for which will be a simple string but for which must be specified as . The .NET type of the column to be read. The value of the column Returns whether the current column is null. Skips the current column without interpreting its value. Cancels an ongoing export. Completes that binary export and sets the connection back to idle state Provides an API for a binary COPY FROM operation, a high-performance data import mechanism to a PostgreSQL table. Initiated by See http://www.postgresql.org/docs/current/static/sql-copy.html. The number of columns in the current (not-yet-written) row. The number of columns, as returned from the backend in the CopyInResponse. NpgsqlParameter instance needed in order to pass the from the validation phase to the writing phase. Starts writing a single row, must be invoked before writing any columns. Writes a single column in the current row. The value to be written The type of the column to be written. This must correspond to the actual type or data corruption will occur. If in doubt, use to manually specify the type. Writes a single column in the current row as type . The value to be written In some cases isn't enough to infer the data type to be written to the database. This parameter and be used to unambiguously specify the type. An example is the JSONB type, for which will be a simple string but for which must be specified as . The .NET type of the column to be written. Writes a single null column value. Writes an entire row of columns. Equivalent to calling , followed by multiple on each value. An array of column values to be written as a single row Cancels and terminates an ongoing import. Any data already written will be discarded. Completes that binary import and sets the connection back to idle state Completes the import process and signals to the database to write everything. Represents a SQL statement or function (stored procedure) to execute against a PostgreSQL database. This class cannot be inherited. If this command is (explicitly) prepared, references the connector on which the preparation happened. Used to detect when the connector was changed (i.e. connection open/close), meaning that the command is no longer prepared. Returns details about each statement that this command has executed. Is only populated when an Execute* method is called. Initializes a new instance of the NpgsqlCommand class. Initializes a new instance of the NpgsqlCommand class with the text of the query. The text of the query. Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. The text of the query. A NpgsqlConnection that represents the connection to a PostgreSQL server. Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. The text of the query. A NpgsqlConnection that represents the connection to a PostgreSQL server. The NpgsqlTransaction in which the NpgsqlCommand executes. Gets or sets the SQL statement or function (stored procedure) to execute at the data source. The Transact-SQL statement or stored procedure to execute. The default is an empty string. Gets or sets the wait time before terminating the attempt to execute a command and generating an error. The time (in seconds) to wait for the command to execute. The default value is 30 seconds. Gets or sets a value indicating how the CommandText property is to be interpreted. One of the CommandType values. The default is CommandType.Text. DB connection. Gets or sets the NpgsqlConnection used by this instance of the NpgsqlCommand. The connection to a data source. The default value is a null reference. Design time visible. Gets or sets how command results are applied to the DataRow when used by the DbDataAdapter.Update(DataSet) method. One of the UpdateRowSource values. Returns whether this query will execute as a prepared (compiled) query. Marks all of the query's result columns as either known or unknown. Unknown results column are requested them from PostgreSQL in text format, and Npgsql makes no attempt to parse them. They will be accessible as strings only. Marks the query's result columns as known or unknown, on a column-by-column basis. Unknown results column are requested them from PostgreSQL in text format, and Npgsql makes no attempt to parse them. They will be accessible as strings only. If the query includes several queries (e.g. SELECT 1; SELECT 2), this will only apply to the first one. The rest of the queries will be fetched and parsed as usual. The array size must correspond exactly to the number of result columns the query returns, or an error will be raised. Marks result types to be used when using GetValue on a data reader, on a column-by-column basis. Used for Entity Framework 5-6 compability. Only primitive numerical types and DateTimeOffset are supported. Set the whole array or just a value to null to use default type. Gets the current state of the connector Creates a new instance of an DbParameter object. An DbParameter object. Creates a new instance of a NpgsqlParameter object. A NpgsqlParameter object. DB parameter collection. Gets the NpgsqlParameterCollection. The parameters of the SQL statement or function (stored procedure). The default is an empty collection. Creates a prepared version of the command on a PostgreSQL server. Unprepares a command, closing server-side statements associated with it. Note that this only affects commands explicitly prepared with , not automatically prepared statements. Executes a SQL statement against the connection and returns the number of rows affected. The number of rows affected if known; -1 otherwise. Asynchronous version of The token to monitor for cancellation requests. A task representing the asynchronous operation, with the number of rows affected if known; -1 otherwise. Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. The first column of the first row in the result set, or a null reference if the result set is empty. Asynchronous version of The token to monitor for cancellation requests. A task representing the asynchronous operation, with the first column of the first row in the result set, or a null reference if the result set is empty. Executes the CommandText against the Connection, and returns an DbDataReader. Unlike the ADO.NET method which it replaces, this method returns a Npgsql-specific DataReader. A DbDataReader object. Executes the CommandText against the Connection, and returns an DbDataReader using one of the CommandBehavior values. Unlike the ADO.NET method which it replaces, this method returns a Npgsql-specific DataReader. A DbDataReader object. Executes the command text against the connection. An instance of . A task representing the operation. Executes the command text against the connection. DB transaction. Gets or sets the NpgsqlTransaction within which the NpgsqlCommand executes. The NpgsqlTransaction. The default value is a null reference. Attempts to cancel the execution of a NpgsqlCommand. As per the specs, no exception will be thrown by this method in case of failure Releases the resources used by the NpgsqlCommand. Fixes up the text/binary flag on result columns. Since Prepare() describes a statement rather than a portal, the resulting RowDescription will have text format on all result columns. Fix that up. Note that UnknownResultTypeList only applies to the first query, while AllResultTypesAreUnknown applies to all of them. Create a new command based on this one. A new NpgsqlCommand object. Create a new command based on this one. A new NpgsqlCommand object. This class is responsible to create database commands for automatic insert, update and delete operations. Initializes a new instance of the class. Initializes a new instance of the class. The adapter. Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. The beginning character or characters to use. The default is an empty string. Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. The ending character or characters to use. The default is an empty string. This method is reponsible to derive the command parameter list with values obtained from function definition. It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. Parameters name will be parameter1, parameter2, ... NpgsqlCommand whose function parameters will be obtained. Gets the automatically generated object required to perform insertions at the data source. The automatically generated object required to perform insertions. Gets the automatically generated object required to perform insertions at the data source, optionally using columns for parameter names. If true, generate parameter names matching column names, if possible. If false, generate @p1, @p2, and so on. The automatically generated object required to perform insertions. Gets the automatically generated System.Data.Common.DbCommand object required to perform updates at the data source. The automatically generated System.Data.Common.DbCommand object required to perform updates. Gets the automatically generated object required to perform updates at the data source, optionally using columns for parameter names. If true, generate parameter names matching column names, if possible. If false, generate @p1, @p2, and so on. The automatically generated object required to perform updates. Gets the automatically generated System.Data.Common.DbCommand object required to perform deletions at the data source. The automatically generated System.Data.Common.DbCommand object required to perform deletions. Gets the automatically generated object required to perform deletions at the data source, optionally using columns for parameter names. If true, generate parameter names matching column names, if possible. If false, generate @p1, @p2, and so on. The automatically generated object required to perform deletions. Applies the parameter information. The parameter. The row. Type of the statement. if set to true [where clause]. Returns the name of the specified parameter in the format of @p#. The number to be included as part of the parameter's name.. The name of the parameter with the specified number appended as part of the parameter name. Returns the full parameter name, given the partial parameter name. The partial name of the parameter. The full parameter name corresponding to the partial parameter name requested. Returns the placeholder for the parameter in the associated SQL statement. The number to be included as part of the parameter's name. The name of the parameter with the specified number appended. Registers the to handle the event for a . The to be used for the update. Adds an event handler for the event. The sender A instance containing information about the event. Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier. The original unquoted identifier. The quoted version of the identifier. Embedded quotes within the identifier are properly escaped. Unquoted identifier parameter cannot be null Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier. The identifier that will have its embedded quotes removed. The unquoted identifier, with embedded quotes properly un-escaped. Quoted identifier parameter cannot be null This class represents a connection to a PostgreSQL server. The connection string, without the password after open (unless Persist Security Info=true) The original connection string provided by the user, including the password. The connector object connected to the backend. The parsed connection string set by the user The default TCP/IP port for PostgreSQL. Maximum value for connection timeout. Initializes a new instance of the NpgsqlConnection class. Initializes a new instance of with the given connection string. The connection used to open the PostgreSQL database. Opens a database connection with the property settings specified by the ConnectionString. This is the asynchronous version of . Do not invoke other methods and properties of the object until the returned Task is complete. The cancellation instruction. A task representing the asynchronous operation. Gets or sets the string used to connect to a PostgreSQL database. See the manual for details. The connection string that includes the server name, the database name, and other parameters needed to establish the initial connection. The default value is an empty string. Backend server host name. Backend server port. If true, the connection will attempt to use SslStream instead of an internal TlsClientStream. Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error. The time (in seconds) to wait for a connection to open. The default value is 15 seconds. Gets the time to wait while trying to execute a command before terminating the attempt and generating an error. The time (in seconds) to wait for a command to complete. The default value is 20 seconds. Gets the name of the current database or the database to be used after a connection is opened. The name of the current database or the name of the database to be used after a connection is opened. The default value is the empty string. Gets the string identifying the database server (host and port) Whether to use Windows integrated security to log in. User name. Gets the current state of the connection. A bitwise combination of the ConnectionState values. The default is Closed. Gets whether the current state of the connection is Open or Closed ConnectionState.Open, ConnectionState.Closed or ConnectionState.Connecting Creates and returns a DbCommand object associated with the IDbConnection. A DbCommand object. Creates and returns a NpgsqlCommand object associated with the NpgsqlConnection. A NpgsqlCommand object. Begins a database transaction with the specified isolation level. The isolation level under which the transaction should run. An DbTransaction object representing the new transaction. Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions. Begins a database transaction. A NpgsqlTransaction object representing the new transaction. Currently there's no support for nested transactions. Transactions created by this method will have Read Committed isolation level. Begins a database transaction with the specified isolation level. The isolation level under which the transaction should run. A NpgsqlTransaction object representing the new transaction. Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions. Enlist transation. releases the connection to the database. If the connection is pooled, it will be made available for re-use. If it is non-pooled, the actual connection will be shutdown. Closes ongoing operations, i.e. an open reader exists or a COPY operation still in progress, as part of a connection close. Does nothing if the thread has been aborted - the connector will be closed immediately. Releases all resources used by the NpgsqlConnection. true when called from Dispose(); false when being called from the finalizer. Occurs on NoticeResponses from the PostgreSQL backend. Occurs on NotificationResponses from the PostgreSQL backend. Returns whether SSL is being used for the connection. Selects the local Secure Sockets Layer (SSL) certificate used for authentication. See Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication. Ignored if is set. See Version of the PostgreSQL backend. This can only be called when there is an active connection. PostgreSQL server version. Process id of backend server. This can only be called when there is an active connection. Report whether the backend is expecting standard conformant strings. In version 8.1, Postgres began reporting this value (false), but did not actually support standard conformant strings. In version 8.2, Postgres began supporting standard conformant strings, but defaulted this flag to false. As of version 9.1, this flag defaults to true. Report whether the backend understands the string literal E prefix (>= 8.1). Begins a binary COPY FROM STDIN operation, a high-performance data import mechanism to a PostgreSQL table. A COPY FROM STDIN SQL command A which can be used to write rows and columns See http://www.postgresql.org/docs/current/static/sql-copy.html. Begins a binary COPY TO STDOUT operation, a high-performance data export mechanism from a PostgreSQL table. A COPY TO STDOUT SQL command A which can be used to read rows and columns See http://www.postgresql.org/docs/current/static/sql-copy.html. Begins a textual COPY FROM STDIN operation, a data import mechanism to a PostgreSQL table. It is the user's responsibility to send the textual input according to the format specified in . A COPY FROM STDIN SQL command A TextWriter that can be used to send textual data. See http://www.postgresql.org/docs/current/static/sql-copy.html. Begins a textual COPY TO STDOUT operation, a data export mechanism from a PostgreSQL table. It is the user's responsibility to parse the textual input according to the format specified in . A COPY TO STDOUT SQL command A TextReader that can be used to read textual data. See http://www.postgresql.org/docs/current/static/sql-copy.html. Begins a raw binary COPY operation (TO STDOUT or FROM STDIN), a high-performance data export/import mechanism to a PostgreSQL table. Note that unlike the other COPY API methods, doesn't implement any encoding/decoding and is unsuitable for structured import/export operation. It is useful mainly for exporting a table as an opaque blob, for the purpose of importing it back later. A COPY TO STDOUT or COPY FROM STDIN SQL command A that can be used to read or write raw binary data. See http://www.postgresql.org/docs/current/static/sql-copy.html. Maps a CLR enum to a PostgreSQL enum type for use with this connection. CLR enum labels are mapped by name to PostgreSQL enum labels. The translation strategy can be controlled by the parameter, which defaults to . You can also use the on your enum fields to manually specify a PostgreSQL enum label. If there is a discrepancy between the .NET and database labels while an enum is read or written, an exception will be raised. Can only be invoked on an open connection; if the connection is closed the mapping is lost. To avoid mapping the type for each connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to The .NET enum type to be mapped Maps a CLR enum to a PostgreSQL enum type for use with all connections created from now on. Existing connections aren't affected. CLR enum labels are mapped by name to PostgreSQL enum labels. The translation strategy can be controlled by the parameter, which defaults to . You can also use the on your enum fields to manually specify a PostgreSQL enum label. If there is a discrepancy between the .NET and database labels while an enum is read or written, an exception will be raised. To map the type for a specific connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to The .NET enum type to be mapped Removes a previous global enum mapping. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to Maps a CLR type to a PostgreSQL composite type for use with this connection. CLR fields and properties by string to PostgreSQL enum labels. The translation strategy can be controlled by the parameter, which defaults to . You can also use the on your members to manually specify a PostgreSQL enum label. If there is a discrepancy between the .NET and database labels while a composite is read or written, an exception will be raised. Can only be invoked on an open connection; if the connection is closed the mapping is lost. To avoid mapping the type for each connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to The .NET type to be mapped Maps a CLR type to a PostgreSQL composite type for use with all connections created from now on. Existing connections aren't affected. CLR fields and properties by string to PostgreSQL enum labels. The translation strategy can be controlled by the parameter, which defaults to . You can also use the on your members to manually specify a PostgreSQL enum label. If there is a discrepancy between the .NET and database labels while a composite is read or written, an exception will be raised. To map the type for a specific connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to The .NET type to be mapped Removes a previous global enum mapping. A PostgreSQL type name for the corresponding enum type in the database. If null, the name translator given in will be used. A component which will be used to translate CLR names (e.g. SomeClass) into database names (e.g. some_class). Defaults to Waits until an asynchronous PostgreSQL messages (e.g. a notification) arrives, and exits immediately. The asynchronous message is delivered via the normal events (, ). The time-out value, in milliseconds, passed to . The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. true if an asynchronous message was received, false if timed out. Waits until an asynchronous PostgreSQL messages (e.g. a notification) arrives, and exits immediately. The asynchronous message is delivered via the normal events (, ). The time-out value is passed to . true if an asynchronous message was received, false if timed out. Waits until an asynchronous PostgreSQL messages (e.g. a notification) arrives, and exits immediately. The asynchronous message is delivered via the normal events (, ). Waits asynchronously until an asynchronous PostgreSQL messages (e.g. a notification) arrives, and exits immediately. The asynchronous message is delivered via the normal events (, ). CancelationToken can not cancel wait operation if underlying NetworkStream does not support it (see https://stackoverflow.com/questions/12421989/networkstream-readasync-with-a-cancellation-token-never-cancels ). Waits asynchronously until an asynchronous PostgreSQL messages (e.g. a notification) arrives, and exits immediately. The asynchronous message is delivered via the normal events (, ). Returns the supported collections Returns the schema collection specified by the collection name. The collection name. The collection specified. Returns the schema collection specified by the collection name filtered by the restrictions. The collection name. The restriction values to filter the results. A description of the restrictions is contained in the Restrictions collection. The collection specified. Creates a closed connection with the connection string and authentication details of this message. Clones this connection, replacing its connection string with the given one. This allows creating a new connection with the same security information (password, SSL callbacks) while changing other connection parameters (e.g. database or pooling) This method changes the current database by disconnecting from the actual database and connecting to the specified. The name of the database to use in place of the current database. DB provider factory. Clear connection pool. Clear all connection pools. Unprepares all prepared statements on this connection. Flushes the type cache for this connection's connection string and reloads the types for this connection only. Represents the method that handles the Notice events. The source of the event. A NpgsqlNoticeEventArgs that contains the event data. Represents the method that handles the Notification events. The source of the event. A NpgsqlNotificationEventArgs that contains the event data. Represents the method that allows the application to provide a certificate collection to be used for SSL client authentication A X509CertificateCollection to be filled with one or more client certificates. Provides a simple way to create and manage the contents of connection strings used by the class. Makes all valid keywords for a property to that property (e.g. User Name -> Username, UserId -> Username...) Maps CLR property names (e.g. BufferSize) to their canonical keyword name, which is the property's [DisplayName] (e.g. Buffer Size) Maps each property to its [DefaultValue] Initializes a new instance of the NpgsqlConnectionStringBuilder class. Initializes a new instance of the NpgsqlConnectionStringBuilder class, optionally using ODBC rules for quoting values. true to use {} to delimit fields; false to use quotation marks. Initializes a new instance of the NpgsqlConnectionStringBuilder class and sets its . Gets or sets the value associated with the specified key. The key of the item to get or set. The value associated with the specified key. Adds an item to the . The key-value pair to be added. Removes the entry with the specified key from the DbConnectionStringBuilder instance. The key of the key/value pair to be removed from the connection string in this DbConnectionStringBuilder. true if the key existed within the connection string and was removed; false if the key did not exist. Removes the entry from the DbConnectionStringBuilder instance. The key/value pair to be removed from the connection string in this DbConnectionStringBuilder. true if the key existed within the connection string and was removed; false if the key did not exist. Clears the contents of the instance. Determines whether the contains a specific key. The key to locate in the . true if the contains an entry with the specified key; otherwise false. Determines whether the contains a specific key-value pair. The itemto locate in the . true if the contains the entry; otherwise false. Retrieves a value corresponding to the supplied key from this . The key of the item to retrieve. The value corresponding to the key. true if keyword was found within the connection string, false otherwise. The hostname or IP address of the PostgreSQL server to connect to. The TCP/IP port of the PostgreSQL server. The PostgreSQL database to connect to. The username to connect with. Not required if using IntegratedSecurity. The password to connect with. Not required if using IntegratedSecurity. The optional application name parameter to be sent to the backend during connection initiation. Whether to enlist in an ambient TransactionScope. Gets or sets the schema search path. Gets or sets the client_encoding parameter. Gets or sets the .NET encoding that will be used to encode/decode PostgreSQL string data. Controls whether SSL is required, disabled or preferred, depending on server support. Whether to trust the server certificate without validating it. Whether to check the certificate revocation list during authentication. False by default. Npgsql uses its own internal implementation of TLS/SSL. Turn this on to use .NET SslStream instead. Whether to use Windows integrated security to log in. The Kerberos service name to be used for authentication. The Kerberos realm to be used for authentication. Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Whether connection pooling should be used. The minimum connection pool size. The maximum connection pool size. The time to wait before closing idle connections in the pool if the count of all connections exceeds MinPoolSize. The time (in seconds) to wait. The default value is 300. How many seconds the pool waits before attempting to prune idle connections that are beyond idle lifetime (. The interval (in seconds). The default value is 10. The time to wait (in seconds) while trying to establish a connection before terminating the attempt and generating an error. Defaults to 15 seconds. The time to wait (in seconds) while trying to execute a command before terminating the attempt and generating an error. Defaults to 30 seconds. The time to wait (in seconds) while trying to execute a an internal command before terminating the attempt and generating an error. The database template to specify when creating a database in Entity Framework. If not specified, PostgreSQL defaults to "template1". http://www.postgresql.org/docs/current/static/manage-ag-templatedbs.html The database admin to specify when creating and dropping a database in Entity Framework. This is needed because Npgsql needs to connect to a database in order to send the create/drop database command. If not specified, defaults to "template1". Check NpgsqlServices.UsingPostgresDBConnection for more information. The number of seconds of connection inactivity before Npgsql sends a keepalive query. Set to 0 (the default) to disable. The number of seconds of connection inactivity before a TCP keepalive query is sent. Use of this option is discouraged, use instead if possible. Set to 0 (the default) to disable. Supported only on Windows. The interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgement is received. Defaults to the value of . must be non-zero as well. Supported only on Windows. Determines the size of the internal buffer Npgsql uses when reading. Increasing may improve performance if transferring large values from the database. Determines the size of the internal buffer Npgsql uses when writing. Increasing may improve performance if transferring large values to the database. Determines the size of socket read buffer. Determines the size of socket send buffer. The maximum number SQL statements that can be automatically prepared at any given point. Beyond this number the least-recently-used statement will be recycled. Zero (the default) disables automatic preparation. The minimum number of usages an SQL statement is used before it's automatically prepared. Defaults to 5. Writes connection performance information to performance counters. If set to true, a pool connection's state won't be reset when it is closed (improves performance). Do not specify this unless you know what you're doing. A compatibility mode for special PostgreSQL server types. Makes MaxValue and MinValue timestamps and dates readable as infinity and negative infinity. Obsolete, see http://www.npgsql.org/doc/migration/3.1.html Obsolete, see http://www.npgsql.org/doc/migration/3.1.html Obsolete, see http://www.npgsql.org/doc/migration/3.1.html Obsolete, see http://www.npgsql.org/doc/migration/3.0.html Obsolete, see http://www.npgsql.org/doc/migration/3.0.html Determines whether the specified object is equal to the current object. Hash function. Gets an ICollection{string} containing the keys of the . Gets an ICollection{string} containing the values in the . Copies the elements of the to an Array, starting at a particular Array index. The one-dimensional Array that is the destination of the elements copied from . The Array must have zero-based indexing. The zero-based index in array at which copying begins. Returns an enumerator that iterates through the . Marks on which participate in the connection string. Optionally holds a set of synonyms for the property. Holds a list of synonyms for the property. Creates a . Creates a . An option specified in the connection string that activates special compatibility features. No special server compatibility mode is active The server is an Amazon Redshift instance. Specifies how to manage SSL. SSL is disabled. If the server requires SSL, the connection will fail. Prefer SSL connections if the server allows them, but allow connections without SSL. Fail the connection if the server doesn't suppotr SSL. Represents a connection to a PostgreSQL backend. Unlike NpgsqlConnection objects, which are exposed to users, connectors are internal to Npgsql and are recycled by the connection pool. This Stream is placed between NegotiateStream and the socket's NetworkStream (or SSLStream). It intercepts traffic and performs the following operations: * Outgoing messages are framed in PostgreSQL's PasswordMessage, and incoming are stripped of it. * NegotiateStream frames payloads with a 5-byte header, which PostgreSQL doesn't understand. This header is stripped from outgoing messages and added to incoming ones. See https://referencesource.microsoft.com/#System/net/System/Net/_StreamFramer.cs,16417e735f0e9530,references The physical connection socket to the backend. The physical connection stream to the backend, without anything on top. The physical connection stream to the backend, layered with an SSL/TLS stream if in secure mode. Buffer used for reading data. If we read a data row that's bigger than , we allocate an oversize buffer. The original (smaller) buffer is stored here, and restored when the connection is reset. Buffer used for writing data. Version of backend server this connector is connected to. The secret key of the backend for this connector, used for query cancellation. The process ID of the backend for this connector. A unique ID identifying this connector, used for logging. Currently mapped to BackendProcessId The current transaction status for this connector. The transaction currently in progress, if any. Note that this doesn't mean a transaction request has actually been sent to the backend - for efficiency we defer sending the request to the first query after BeginTransaction is called. See for the actual transaction status. Also, the user can initiate a transaction in SQL (i.e. BEGIN), in which case there will be no NpgsqlTransaction instance. As a result, never check to know whether a transaction is in progress, check instead. The NpgsqlConnection that (currently) owns this connector. Null if the connector isn't owned (i.e. idle in the pool) The number of messages that were prepended to the current message chain, but not yet sent. Note that this only tracks messages which produce a ReadyForQuery message If the connector is currently in COPY mode, holds a reference to the importer/exporter object. Otherwise null. Holds all run-time parameters received from the backend (via ParameterStatus messages) The timeout for reading messages that are part of the user's command (i.e. which aren't internal prepended commands). Contains the current value of the socket's ReceiveTimeout, used to determine whether we need to change it when commands are received. A lock that's taken while a user action is in progress, e.g. a command being executed. A lock that's taken while a cancellation is being delivered; new queries are blocked until the cancellation is delivered. This reduces the chance that a cancellation meant for a previous command will accidentally cancel a later one, see #615. The command currently being executed by the connector, null otherwise. Used only for concurrent use error reporting purposes. If pooled, the timestamp when this connector was returned to the pool. The minimum timeout that can be set on internal commands such as COMMIT, ROLLBACK. Creates a new connector with the given connection string. The parsed connection string. The connection string. Gets the current state of the connector Returns whether the connector is open, regardless of any task it is currently performing Opens the physical connection to the server. Usually called by the RequestConnector Method of the connection pool manager. Prepends a message to be sent at the beginning of the next message chain. Reads backend messages and discards them, stopping only after a message of the given type has been seen. Reads backend messages and discards them, stopping only after a message of the given types has been seen. Reads a single message, expecting it to be of type . Any other message causes an exception to be raised and the connector to be broken. Asynchronous messages (e.g. Notice) are treated and ignored. ErrorResponses raise an exception but do not cause the connector to break. Handles a new transaction indicator received on a ReadyForQuery message Returns whether SSL is being used for the connection Creates another connector and sends a cancel request through it for this connector. Called when an unexpected message has been received during an action. Breaks the connector and returns the appropriate message. Called when a connector becomes completely unusable, e.g. when an unexpected I/O exception is raised or when we lose protocol sync. Note that fatal errors during the Open phase do *not* pass through here. Closes the socket and cleans up client-side resources associated with this connector. Called when a pooled connection is closed, and its connector is returned to the pool. Resets the connector back to its initial state, releasing server-side sources (e.g. prepared statements), resetting parameters to their defaults, and resetting client-side state An IDisposable wrapper around . Whether the backend is an AWS Redshift instance Expresses the exact state of a connector. The connector has either not yet been opened or has been closed. The connector is currently connecting to a Postgresql server. The connector is connected and may be used to send a new query. The connector is waiting for a response to a query which has been sent to the server. The connector is currently fetching and processing query results. The connector is currently waiting for asynchronous notifications to arrive. The connection was broken because an unexpected error occurred which left it in an unknown state. This state isn't implemented yet. The connector is engaged in a COPY operation. Currently not in a transaction block Currently in a transaction block Currently in a failed transaction block (queries will be rejected until block is ended) A new transaction has been requested but not yet transmitted to the backend. It will be transmitted prepended to the next query. This is a client-side state option only, and is never transmitted from the backend. Specifies how to load/parse DataRow messages as they're received from the backend. Load DataRows in non-sequential mode Load DataRows in sequential mode Skip DataRow messages altogether Represents the method that handles the RowUpdated events. The source of the event. A NpgsqlRowUpdatedEventArgs that contains the event data. Represents the method that handles the RowUpdating events. The source of the event. A NpgsqlRowUpdatingEventArgs that contains the event data. This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. Row updated event. Row updating event. Default constructor. Constructor. Constructor. Constructor. Create row updated event. Create row updating event. Raise the RowUpdated event. Raise the RowUpdating event. Delete command. Select command. Update command. Insert command. Reads a forward-only stream of rows from a data source. Holds the list of statements being executed by this reader. The index of the current query resultset we're processing (within a multiquery) The RowDescription message for the current resultset being processed Indicates that at least one row has been read across all result sets Whether the current result set has rows If HasRows was called before any rows were read, it was forced to read messages. A pending message may be stored here for processing in the next Read() or NextResult(). Is raised whenever Close() is called. The first row in a stored procedure command that has output parameters needs to be traversed twice - once for populating the output parameters and once for the actual result set traversal. So in this case we can't be sequential. Advances the reader to the next record in a result set. true if there are more rows; otherwise false. The default position of a data reader is before the first record. Therefore, you must call Read to begin accessing data. This is the asynchronous version of The cancellation token is currently ignored. Ignored for now. A task representing the asynchronous operation. Advances the reader to the next result when reading the results of a batch of statements. This is the asynchronous version of NextResult. The parameter is currently ignored. Currently ignored. A task representing the asynchronous operation. Note that in SchemaOnly mode there are no resultsets, and we read nothing from the backend (all RowDescriptions have already been processed and are available) Gets a value indicating the depth of nesting for the current row. Always returns zero. Gets a value indicating whether the data reader is closed. Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. Returns details about each statement that this reader will or has executed. Note that some fields (i.e. rows and oid) are only populated as the reader traverses the result. For commands with multiple queries, this exposes the number of rows affected on a statement-by-statement basis, unlike which exposes an aggregation across all statements. Gets a value that indicates whether this DbDataReader contains one or more rows. Indicates whether the reader is currently positioned on a row, i.e. whether reading a column is possible. This property is different from in that will return true even if attempting to read a column will fail, e.g. before has been called Gets the name of the column, given the zero-based column ordinal. The zero-based column ordinal. The name of the specified column. Gets the number of columns in the current row. Consumes all result sets for this reader, leaving the connector ready for sending and processing further queries Releases the resources used by the NpgsqlDataReader. Closes the reader, allowing a new command to be executed. Closes the reader, allowing a new command to be executed. Returns the current row, or throws an exception if a row isn't available Gets the value of the specified column as a Boolean. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a byte. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a single character. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a 16-bit signed integer. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a 32-bit signed integer. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a 64-bit signed integer. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a object. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as an instance of . The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a object. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a double-precision floating point number. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a single-precision floating point number. The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a globally-unique identifier (GUID). The zero-based column ordinal. The value of the specified column. Populates an array of objects with the column values of the current row. An array of Object into which to copy the attribute columns. The number of instances of in the array. Gets the value of the specified column as an instance of . The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as an , Npgsql's provider-specific type for dates. PostgreSQL's date type represents dates from 4713 BC to 5874897 AD, while .NET's DateTime only supports years from 1 to 1999. If you require years outside this range use this accessor. The standard method will also return this type, but has the disadvantage of boxing the value. See http://www.postgresql.org/docs/current/static/datatype-datetime.html The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as a TimeSpan, PostgreSQL's interval type has has a resolution of 1 microsecond and ranges from -178000000 to 178000000 years, while .NET's TimeSpan has a resolution of 100 nanoseconds and ranges from roughly -29247 to 29247 years. See http://www.postgresql.org/docs/current/static/datatype-datetime.html The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as an , Npgsql's provider-specific type for time spans. PostgreSQL's interval type has has a resolution of 1 microsecond and ranges from -178000000 to 178000000 years, while .NET's TimeSpan has a resolution of 100 nanoseconds and ranges from roughly -29247 to 29247 years. If you require values from outside TimeSpan's range use this accessor. The standard ADO.NET method will also return this type, but has the disadvantage of boxing the value. See http://www.postgresql.org/docs/current/static/datatype-datetime.html The zero-based column ordinal. The value of the specified column. Gets the value of the specified column as an , Npgsql's provider-specific type for date/time timestamps. Note that this type covers both PostgreSQL's "timestamp with time zone" and "timestamp without time zone" types, which differ only in how they are converted upon input/output. PostgreSQL's timestamp type represents dates from 4713 BC to 5874897 AD, while .NET's DateTime only supports years from 1 to 1999. If you require years outside this range use this accessor. The standard method will also return this type, but has the disadvantage of boxing the value. See http://www.postgresql.org/docs/current/static/datatype-datetime.html The zero-based column ordinal. The value of the specified column. Reads a stream of bytes from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. The zero-based column ordinal. The index within the row from which to begin the read operation. The buffer into which to copy the data. The index with the buffer to which the data will be copied. The maximum number of characters to read. The actual number of bytes read. Retrieves data as a . The zero-based column ordinal. The returned object. Retrieves data as a . The zero-based column ordinal. The returned object. Reads a stream of characters from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. The zero-based column ordinal. The index within the row from which to begin the read operation. The buffer into which to copy the data. The index with the buffer to which the data will be copied. The maximum number of characters to read. The actual number of characters read. Retrieves data as a . The zero-based column ordinal. The returned object. Retrieves data as a . The zero-based column ordinal. The returned object. Gets a value that indicates whether the column contains nonexistent or missing values. The zero-based column ordinal. true if the specified column is equivalent to ; otherwise false. An asynchronous version of , which gets a value that indicates whether the column contains non-existent or missing values. The parameter is currently ignored. The zero-based column to be retrieved. Currently ignored. true if the specified column value is equivalent to otherwise false. Gets the value of the specified column as an instance of . The name of the column. The value of the specified column. Gets the column ordinal given the name of the column. The name of the column. The zero-based column ordinal. Gets a representation of the PostgreSQL data type for the specified field. The returned representation can be used to access various information about the field. The zero-based column index. Gets the data type information for the specified field. This will be the PostgreSQL type name (e.g. int4) as in the pg_type table, not the .NET type (see for that). The zero-based column index. Gets the OID for the PostgreSQL type for the specified field, as it appears in the pg_type table. This is a PostgreSQL-internal value that should not be relied upon and should only be used for debugging purposes. The zero-based column index. Gets the data type of the specified column. The zero-based column ordinal. The data type of the specified column. Returns the provider-specific field type of the specified column. The zero-based column ordinal. The Type object that describes the data type of the specified column. Gets the value of the specified column as an instance of . The zero-based column ordinal. The value of the specified column. Synchronously gets the value of the specified column as a type. Synchronously gets the value of the specified column as a type. The column to be retrieved. The column to be retrieved. Asynchronously gets the value of the specified column as a type. The parameter is currently ignored. The type of the value to be returned. The column to be retrieved. Currently ignored. A task representing the asynchronous operation. Gets the value of the specified column as an instance of . The zero-based column ordinal. The value of the specified column. Gets all provider-specific attribute columns in the collection for the current row. An array of Object into which to copy the attribute columns. The number of instances of in the array. Returns an that can be used to iterate through the rows in the data reader. An that can be used to iterate through the rows in the data reader. Returns schema information for the columns in the current resultset. Returns a System.Data.DataTable that describes the column metadata of the DataReader. The exception that is thrown when server-related issues occur. PostgreSQL errors (e.g. query SQL issues, constraint violations) are raised via which is a subclass of this class. Purely Npgsql-related issues which aren't related to the server will be raised via the standard CLR exceptions (e.g. ArgumentException). Initializes a new instance of the class. Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. Initializes a new instance of the class with a specified error message. The message that describes the error. Specifies whether the exception is considered transient, that is, whether retrying to operation could succeed (e.g. a network error). Initializes a new instance of the class with serialized data. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. A factory to create instances of various Npgsql objects. Gets an instance of the . This can be used to retrieve strongly typed data objects. Returns a strongly typed instance. Returns a strongly typed instance. Returns a strongly typed instance. Returns a strongly typed instance. Returns a strongly typed instance. Returns a strongly typed instance. Gets the service object of the specified type. An object that specifies the type of service object to get. A service object of type serviceType, or null if there is no service object of type serviceType. Large object manager. This class can be used to store very large files in a PostgreSQL database. The largest chunk size (in bytes) read and write operations will read/write each roundtrip to the network. Default 4 MB. Creates an NpgsqlLargeObjectManager for this connection. The connection must be opened to perform remote operations. Execute a function Execute a function that returns a byte array Create an empty large object in the database. If an oid is specified but is already in use, an PostgresException will be thrown. A preferred oid, or specify 0 if one should be automatically assigned The oid for the large object created If an oid is already in use Create an empty large object in the database. If an oid is specified but is already in use, an PostgresException will be thrown. A preferred oid, or specify 0 if one should be automatically assigned Cancellation token. The oid for the large object created If an oid is already in use Opens a large object on the backend, returning a stream controlling this remote object. A transaction snapshot is taken by the backend when the object is opened with only read permissions. When reading from this object, the contents reflects the time when the snapshot was taken. Note that this method, as well as operations on the stream must be wrapped inside a transaction. Oid of the object An NpgsqlLargeObjectStream Opens a large object on the backend, returning a stream controlling this remote object. A transaction snapshot is taken by the backend when the object is opened with only read permissions. When reading from this object, the contents reflects the time when the snapshot was taken. Note that this method, as well as operations on the stream must be wrapped inside a transaction. Oid of the object Cancellation token. An NpgsqlLargeObjectStream Opens a large object on the backend, returning a stream controlling this remote object. Note that this method, as well as operations on the stream must be wrapped inside a transaction. Oid of the object An NpgsqlLargeObjectStream Opens a large object on the backend, returning a stream controlling this remote object. Note that this method, as well as operations on the stream must be wrapped inside a transaction. Oid of the object Cancellation token. An NpgsqlLargeObjectStream Deletes a large object on the backend. Oid of the object to delete Deletes a large object on the backend. Oid of the object to delete Cancellation token. Exports a large object stored in the database to a file on the backend. This requires superuser permissions. Oid of the object to export Path to write the file on the backend Exports a large object stored in the database to a file on the backend. This requires superuser permissions. Oid of the object to export Path to write the file on the backend Cancellation token. Imports a large object to be stored as a large object in the database from a file stored on the backend. This requires superuser permissions. Path to read the file on the backend A preferred oid, or specify 0 if one should be automatically assigned Imports a large object to be stored as a large object in the database from a file stored on the backend. This requires superuser permissions. Path to read the file on the backend A preferred oid, or specify 0 if one should be automatically assigned Cancellation token. Since PostgreSQL 9.3, large objects larger than 2GB can be handled, up to 4TB. This property returns true whether the PostgreSQL version is >= 9.3. An interface to remotely control the seekable stream for an opened large object on a PostgreSQL server. Note that the OpenRead/OpenReadWrite method as well as all operations performed on this stream must be wrapped inside a database transaction. Since PostgreSQL 9.3, large objects larger than 2GB can be handled, up to 4TB. This property returns true whether the PostgreSQL version is >= 9.3. Reads count bytes from the large object. The only case when fewer bytes are read is when end of stream is reached. The buffer where read data should be stored. The offset in the buffer where the first byte should be read. The maximum number of bytes that should be read. How many bytes actually read, or 0 if end of file was already reached. Reads count bytes from the large object. The only case when fewer bytes are read is when end of stream is reached. The buffer where read data should be stored. The offset in the buffer where the first byte should be read. The maximum number of bytes that should be read. Cancellation token How many bytes actually read, or 0 if end of file was already reached. Writes count bytes to the large object. The buffer to write data from. The offset in the buffer at which to begin copying bytes. The number of bytes to write. Writes count bytes to the large object. The buffer to write data from. The offset in the buffer at which to begin copying bytes. The number of bytes to write. Cancellation token. CanTimeout always returns false. CanRead always returns true, unless the stream has been closed. CanWrite returns true if the stream was opened with write permissions, and the stream has not been closed. CanSeek always returns true, unless the stream has been closed. Returns the current position in the stream. Getting the current position does not need a round-trip to the server, however setting the current position does. Gets the length of the large object. This internally seeks to the end of the stream to retrieve the length, and then back again. Gets the length of the large object. This internally seeks to the end of the stream to retrieve the length, and then back again. Seeks in the stream to the specified position. This requires a round-trip to the backend. A byte offset relative to the origin parameter. A value of type SeekOrigin indicating the reference point used to obtain the new position. Seeks in the stream to the specified position. This requires a round-trip to the backend. A byte offset relative to the origin parameter. A value of type SeekOrigin indicating the reference point used to obtain the new position. Cancellation token. Does nothing. Truncates or enlarges the large object to the given size. If enlarging, the large object is extended with null bytes. For PostgreSQL versions earlier than 9.3, the value must fit in an Int32. Number of bytes to either truncate or enlarge the large object. Truncates or enlarges the large object to the given size. If enlarging, the large object is extended with null bytes. For PostgreSQL versions earlier than 9.3, the value must fit in an Int32. Number of bytes to either truncate or enlarge the large object. Cancellation token. Releases resources at the backend allocated for this stream. Releases resources at the backend allocated for this stream, iff disposing is true. Whether to release resources allocated at the backend. EventArgs class to send Notification parameters. Process ID of the PostgreSQL backend that sent this notification. Condition that triggered that notification. Additional information. Thrown when trying to use a connection that is already busy performing some other operation. Provides information on the already-executing operation to help with debugging. If the connection is busy with another command, this will contain a reference to that command. Otherwise, if the connection if busy with another type of operation (e.g. COPY), contains null. This class represents a parameter to a command that will be sent to server Can be used to communicate a value from the validation phase to the writing phase. Initializes a new instance of the NpgsqlParameter class. Initializes a new instance of the NpgsqlParameter class with the parameter name and a value of the new NpgsqlParameter. The name of the parameter to map. An Object that is the value of the NpgsqlParameter.

When you specify an Object in the value parameter, the DbType is inferred from the .NET Framework type of the Object.

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

Initializes a new instance of the NpgsqlParameter class with the parameter name and the data type. The name of the parameter to map. One of the DbType values. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the DbType values. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the NpgsqlDbType values. The length of the parameter. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the DbType values. The length of the parameter. Initializes a new instance of the NpgsqlParameter The name of the parameter to map. One of the NpgsqlDbType values. The length of the parameter. The name of the source column. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the DbType values. The length of the parameter. The name of the source column. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the NpgsqlDbType values. The length of the parameter. The name of the source column. One of the ParameterDirection values. true if the value of the field can be null, otherwise false. The total number of digits to the left and right of the decimal point to which Value is resolved. The total number of decimal places to which Value is resolved. One of the DataRowVersion values. An Object that is the value of the NpgsqlParameter. Initializes a new instance of the NpgsqlParameter. The name of the parameter to map. One of the DbType values. The length of the parameter. The name of the source column. One of the ParameterDirection values. true if the value of the field can be null, otherwise false. The total number of digits to the left and right of the decimal point to which Value is resolved. The total number of decimal places to which Value is resolved. One of the DataRowVersion values. An Object that is the value of the NpgsqlParameter. Gets or sets the value of the parameter. An Object that is the value of the parameter. The default value is null. Gets or sets the value of the parameter. An Object that is the value of the parameter. The default value is null. Gets or sets a value that indicates whether the parameter accepts null values. Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. One of the ParameterDirection values. The default is Input. Gets or sets the maximum number of digits used to represent the Value property. The maximum number of digits used to represent the Value property. The default value is 0, which indicates that the data provider sets the precision for Value. Gets or sets the number of decimal places to which Value is resolved. The number of decimal places to which Value is resolved. The default is 0. Gets or sets the maximum size, in bytes, of the data within the column. The maximum size, in bytes, of the data within the column. The default value is inferred from the parameter value. Gets or sets the DbType of the parameter. One of the DbType values. The default is Object. Gets or sets the NpgsqlDbType of the parameter. One of the NpgsqlDbType values. The default is Unknown. Gets or sets The name of the NpgsqlParameter. The name of the NpgsqlParameter. The default is an empty string. Gets or sets The name of the source column that is mapped to the DataSet and used for loading or returning the Value. The name of the source column that is mapped to the DataSet. The default is an empty string. Gets or sets the DataRowVersion to use when loading Value. One of the DataRowVersion values. The default is Current. Source column mapping. Used in combination with NpgsqlDbType.Enum or NpgsqlDbType.Array | NpgsqlDbType.Enum to indicate the enum type. For other NpgsqlDbTypes, this field is not used. Used in combination with NpgsqlDbType.Enum or NpgsqlDbType.Composite to indicate the specific enum or composite type. For other NpgsqlDbTypes, this field is not used. The collection to which this parameter belongs, if any. The name scrubbed of any optional marker Returns whether this parameter has had its type set explicitly via DbType or NpgsqlDbType (and not via type inference) Reset DBType. Creates a new NpgsqlParameter that is a copy of the current instance. A new NpgsqlParameter that is a copy of this instance. Represents a collection of parameters relevant to a NpgsqlCommand as well as their respective mappings to columns in a DataSet. This class cannot be inherited. Initializes a new instance of the NpgsqlParameterCollection class. Invalidate the hash lookup tables. This should be done any time a change may throw the lookups out of sync with the list. Gets the NpgsqlParameter with the specified name. The name of the NpgsqlParameter to retrieve. The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. Gets the NpgsqlParameter at the specified index. The zero-based index of the NpgsqlParameter to retrieve. The NpgsqlParameter at the specified index. Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. The NpgsqlParameter to add to the collection. The index of the new NpgsqlParameter object. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. The name of the NpgsqlParameter. The Value of the NpgsqlParameter to add to the collection. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name, data type and value. The name of the NpgsqlParameter. One of the NpgsqlDbType values. The Value of the NpgsqlParameter to add to the collection. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. The name of the NpgsqlParameter. The Value of the NpgsqlParameter to add to the collection. One of the NpgsqlDbType values. The length of the column. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. The name of the NpgsqlParameter. The Value of the NpgsqlParameter to add to the collection. One of the NpgsqlDbType values. The length of the column. The name of the source column. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified value. The Value of the NpgsqlParameter to add to the collection. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified data type and value. One of the NpgsqlDbType values. The Value of the NpgsqlParameter to add to the collection. The paramater that was added. Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. The name of the parameter. One of the DbType values. The index of the new NpgsqlParameter object. Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. The name of the parameter. One of the DbType values. The length of the column. The index of the new NpgsqlParameter object. Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. The name of the parameter. One of the DbType values. The length of the column. The name of the source column. The index of the new NpgsqlParameter object. Removes the specified NpgsqlParameter from the collection using the parameter name. The name of the NpgsqlParameter object to retrieve. Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. The name of the NpgsqlParameter object to find. true if the collection contains the parameter; otherwise, false. Gets the location of the NpgsqlParameter in the collection with a specific parameter name. The name of the NpgsqlParameter object to find. The zero-based location of the NpgsqlParameter in the collection. Report whether the collection is read only. Always false. Removes the specified NpgsqlParameter from the collection using a specific index. The zero-based index of the parameter. Inserts a NpgsqlParameter into the collection at the specified index. The zero-based index where the parameter is to be inserted within the collection. The NpgsqlParameter to add to the collection. Removes the specified NpgsqlParameter from the collection. The name of the NpgsqlParameter to remove from the collection. Removes the specified NpgsqlParameter from the collection. The NpgsqlParameter to remove from the collection. Gets a value indicating whether a NpgsqlParameter exists in the collection. The value of the NpgsqlParameter object to find. true if the collection contains the NpgsqlParameter object; otherwise, false. Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. The name of the NpgsqlParameter object to find. A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. true if the collection contains the parameter and param will contain the parameter; otherwise, false. Removes all items from the collection. Gets the location of a NpgsqlParameter in the collection. The value of the NpgsqlParameter object to find. The zero-based index of the NpgsqlParameter object in the collection. Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. The NpgsqlParameter to add to the collection. The zero-based index of the new NpgsqlParameter object. Report whether the collection is fixed size. Always false. Report whether the collection is synchronized. Gets the number of NpgsqlParameter objects in the collection. The number of NpgsqlParameter objects in the collection. Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. An Array to which to copy the NpgsqlParameter objects in the collection. The starting index of the array. Gets a value indicating whether the ICollection{T} is read-only. Sync root. Returns an enumerator that can iterate through the collection. An IEnumerator that can be used to iterate through the collection. Add an Array of parameters to the collection. Parameters to add. Get parameter. Get parameter. Set parameter. Set parameter. Report the offset within the collection of the given parameter. Parameter to find. Index of the parameter, or -1 if the parameter is not present. Insert the specified parameter into the collection. Index of the existing parameter before which to insert the new one. Parameter to insert. Report whether the specified parameter is present in the collection. Parameter to find. True if the parameter was found, otherwise false. Remove the specified parameter from the collection. Parameter to remove. True if the parameter was found and removed, otherwise false. Convert collection to a System.Array. Destination array. Starting index in destination array. Convert collection to a System.Array. NpgsqlParameter[] Provides an API for a raw binary COPY operation, a high-performance data import/export mechanism to a PostgreSQL table. Initiated by See http://www.postgresql.org/docs/current/static/sql-copy.html. The copy binary format header signature Cancels and terminates an ongoing operation. Any data already written will be discarded. Writer for a text import, initiated by . See http://www.postgresql.org/docs/current/static/sql-copy.html. Cancels and terminates an ongoing import. Any data already written will be discarded. Reader for a text export, initiated by . See http://www.postgresql.org/docs/current/static/sql-copy.html. Cancels and terminates an ongoing import. Provides the underlying mechanism for reading schema information. Returns the MetaDataCollections that lists all possible collections. The MetaDataCollections Returns the Restrictions that contains the meaning and position of the values in the restrictions array. The Restrictions Returns the Databases that contains a list of all accessable databases. The database connection on which to run the metadataquery. The restrictions to filter the collection. The Databases Returns the Tables that contains table and view names and the database and schema they come from. The database connection on which to run the metadataquery. The restrictions to filter the collection. The Tables Returns the Columns that contains information about columns in tables. The database connection on which to run the metadataquery. The restrictions to filter the collection. The Columns. Returns the Views that contains view names and the database and schema they come from. The database connection on which to run the metadataquery. The restrictions to filter the collection. The Views Returns the Users containing user names and the sysid of those users. The database connection on which to run the metadataquery. The restrictions to filter the collection. The Users. List of keywords taken from PostgreSQL 9.0 reserved words documentation. Represents a single SQL statement within Npgsql. Instances aren't constructed directly; users should construct an object and populate its property as in standard ADO.NET. Npgsql will analyze that property and constructed instances of internally. Users can retrieve instances from and access information about statement execution (e.g. affected rows). The SQL text of the statement. Specifies the type of query, e.g. SELECT. The number of rows affected or retrieved. See the command tag in the CommandComplete message, http://www.postgresql.org/docs/current/static/protocol-message-formats.html For an INSERT, the object ID of the inserted row if is 1 and the target table has OIDs; otherwise 0. The input parameters sent with this statement. The RowDescription message for this query. If null, the query does not return rows (e.g. INSERT) If this statement has been automatically prepared, references the . Null otherwise. Holds the server-side (prepared) statement name. Empty string for non-prepared statements. Whether this statement has already been prepared (including automatic preparation). Returns the SQL text of the statement. Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. Specifies the object associated with the transaction. The object associated with the transaction. Specifies the completion state of the transaction. The completion state of the transaction. Specifies the object associated with the transaction. The object associated with the transaction. Specifies the IsolationLevel for this transaction. The IsolationLevel for this transaction. The default is ReadCommitted. Commits the database transaction. Commits the database transaction. Commits the database transaction. Rolls back a transaction from a pending state. Rolls back a transaction from a pending state. Rolls back a transaction from a pending state. Creates a transaction save point. Rolls back a transaction from a pending savepoint state. Rolls back a transaction from a pending savepoint state. Dispose. Represents a .pgpass file, which contains passwords for noninteractive connections File name being parsed for credentials Initializes a new instance of the class Parses file content and gets all credentials from the file corresponding to all lines in the .pgpass file Searches queries loaded from .PGPASS file to find first entry matching the provided parameters. Hostname to query. Use null to match any. Port to query. Use null to match any. Database to query. Use null to match any. User name to query. Use null to match any. Matching if match was found. Otherwise, returns null. Retrieves the full system path to the pgpass file. Does not check whether the file actually exist. See https://www.postgresql.org/docs/current/static/libpq-pgpass.html Path to the pgpass file Represents a hostname, port, database, username, and password combination that has been retrieved from a .pgpass file Hostname parsed from the .pgpass file Port parsed from the .pgpass file Database parsed from the .pgpass file User name parsed from the .pgpass file Password parsed from the .pgpass file This class represents an entry from the .pgpass file Hostname parsed from the .pgpass file Port parsed from the .pgpass file Database parsed from the .pgpass file User name parsed from the .pgpass file Password parsed from the .pgpass file Creates new based on string in the format hostname:port:database:username:password. The : and \ characters should be escaped with a \. string for the entry from the pgpass file New instance of for the string Entry is not formatted as hostname:port:database:username:password or non-wildcard port is not a number Checks whether this matches the parameters supplied Hostname to check against this entry Port to check against this entry Database to check against this entry Username to check against this entry True if the entry is a match. False otherwise. Checks if 2 strings are a match for a considering that either value can be a wildcard (*) Value being searched Value from the PGPASS entry True if the values are a match. False otherwise. Represents a timeout that will expire at some point. Holds connector pools indexed by their connection strings. Maximum number of possible connections in the pool. Contains the connection string returned to the user from after the connection has been opened. Does not contain the password unless Persist Security Info=true. Open connectors waiting to be requested by new connections Incremented every time this pool is cleared via or . Allows us to identify connections which were created before the clear. Attempts to ensure, on a best-effort basis, that there are enough connections to meet MinPoolSize. This method never throws an exception. The exception that is thrown when the PostgreSQL backend reports errors (e.g. query SQL issues, constraint violations). This exception only corresponds to a PostgreSQL-delivered error. Other errors (e.g. network issues) will be raised via , and purely Npgsql-related issues which aren't related to the server will be raised via the standard CLR exceptions (e.g. ArgumentException). See http://www.postgresql.org/docs/current/static/errcodes-appendix.html, http://www.postgresql.org/docs/current/static/protocol-error-fields.html Severity of the error or notice. Always present. The SQLSTATE code for the error. Always present. See http://www.postgresql.org/docs/current/static/errcodes-appendix.html The SQLSTATE code for the error. Always present. See http://www.postgresql.org/docs/current/static/errcodes-appendix.html The primary human-readable error message. This should be accurate but terse. Always present. An optional secondary error message carrying more detail about the problem. May run to multiple lines. An optional suggestion what to do about the problem. This is intended to differ from Detail in that it offers advice (potentially inappropriate) rather than hard facts. May run to multiple lines. The field value is a decimal ASCII integer, indicating an error cursor position as an index into the original query string. The first character has index 1, and positions are measured in characters not bytes. 0 means not provided. This is defined the same as the field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The field will always appear when this field appears. 0 means not provided. The text of a failed internally-generated command. This could be, for example, a SQL query issued by a PL/pgSQL function. An indication of the context in which the error occurred. Presently this includes a call stack traceback of active PL functions. The trace is one entry per line, most recent first. If the error was associated with a specific database object, the name of the schema containing that object, if any. PostgreSQL 9.3 and up. Table name: if the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.) PostgreSQL 9.3 and up. If the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.) PostgreSQL 9.3 and up. If the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.) PostgreSQL 9.3 and up. If the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.) PostgreSQL 9.3 and up. The file name of the source-code location where the error was reported. PostgreSQL 9.3 and up. The line number of the source-code location where the error was reported. The name of the source-code routine reporting the error. Creates a new instance. Gets a the PostgreSQL error message and code. Specifies whether the exception is considered transient, that is, whether retrying to operation could succeed (e.g. a network error). Check . Returns the statement which triggered this exception. Gets a collection of key/value pairs that provide additional PostgreSQL fields about the exception. Populates a with the data needed to serialize the target object. The to populate with data. The destination (see ) for this serialization. A non-critical (warning or info) message generated by the backend. Can be synchronous (i.e. in response to a query) or asynchronous (a totally unrelated backend-side event). http://www.postgresql.org/docs/current/static/protocol-flow.html#PROTOCOL-ASYNC Severity of the error or notice. Always present. The SQLSTATE code for the error. Always present. See http://www.postgresql.org/docs/current/static/errcodes-appendix.html The SQLSTATE code for the error. Always present. See http://www.postgresql.org/docs/current/static/errcodes-appendix.html The primary human-readable error message. This should be accurate but terse. Always present. An optional secondary error message carrying more detail about the problem. May run to multiple lines. An optional suggestion what to do about the problem. This is intended to differ from Detail in that it offers advice (potentially inappropriate) rather than hard facts. May run to multiple lines. The field value is a decimal ASCII integer, indicating an error cursor position as an index into the original query string. The first character has index 1, and positions are measured in characters not bytes. 0 means not provided. This is defined the same as the field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The field will always appear when this field appears. 0 means not provided. The text of a failed internally-generated command. This could be, for example, a SQL query issued by a PL/pgSQL function. An indication of the context in which the error occurred. Presently this includes a call stack traceback of active PL functions. The trace is one entry per line, most recent first. If the error was associated with a specific database object, the name of the schema containing that object, if any. PostgreSQL 9.3 and up. Table name: if the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.) PostgreSQL 9.3 and up. If the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.) PostgreSQL 9.3 and up. If the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.) PostgreSQL 9.3 and up. If the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.) PostgreSQL 9.3 and up. The file name of the source-code location where the error was reported. PostgreSQL 9.3 and up. The line number of the source-code location where the error was reported. The name of the source-code routine reporting the error. Creates a new instance. Provides data for a notice event. The Notice that was sent from the database. Represents a PostgreSQL array data type, which can hold several multiple values in a single column. See https://www.postgresql.org/docs/current/static/arrays.html. The PostgreSQL data type of the element contained within this array. Constructs a representation of a PostgreSQL array data type. Represents a PostgreSQL base data type, which is a simple scalar value. Constructs a representation of a PostgreSQL base data type. Constructs an unsupported base type (no handler exists in Npgsql for this type) Instantiate the type handler. If it has a constructor that accepts a TypeHandlerRegistry, use that to allow the handler to make connector-specific adjustments. Otherwise (the normal case), use the default constructor. Represents a PostgreSQL composite data type, which can hold multiple fields of varying types in a single column. See https://www.postgresql.org/docs/current/static/rowtypes.html. Holds the name and OID for all fields. Populated on the first activation of the composite. Constructs a representation of a PostgreSQL array data type. Represents a PostgreSQL domain type. See https://www.postgresql.org/docs/current/static/sql-createdomain.html. When PostgreSQL returns a RowDescription for a domain type, the type OID is the base type's (so fetching a domain type over text returns a RowDescription for text). However, when a composite type is returned, the type OID there is that of the domain, so we provide "clean" support for domain types. The PostgreSQL data type of the base type, i.e. the type this domain is based on. Constructs a representation of a PostgreSQL domain data type. Represents a PostgreSQL enum data type. See https://www.postgresql.org/docs/current/static/datatype-enum.html. Constructs a representation of a PostgreSQL enum data type. Represents a PostgreSQL range data type. See https://www.postgresql.org/docs/current/static/rangetypes.html. The PostgreSQL data type of the subtype of this range. Constructs a representation of a PostgreSQL range data type. 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. 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. Constructs a representation of a PostgreSQL data type. The data type's namespace (or schema). The data type's name. The data type's OID. The data type's namespace (or schema). The data type's name. The data type's OID - a unique id identifying the data type in a given database (in pg_type). The full name of the backend type, including its namespace. A display name for this backend type, suitable for display purposes. If the backend type is defined in the default namespace (pg_catalog), it will be omitted. The associated with this backend type, if any. If a PostgreSQL array type exists for this type, it will be referenced here. Otherwise null. If a PostgreSQL range type exists for this type, it will be referenced here. Otherwise null. For base types, contains the handler type. If null, this backend type isn't supported by Npgsql. Returns a string that represents the current object. Represents a PostgreSQL data type that isn't known to Npgsql and cannot be handled. Constructs a the unknown backend type. Internally represents a statement has been prepared, is in the process of being prepared, or is a candidate for preparation (i.e. awaiting further usages). If true, the user explicitly requested this statement be prepared. It does not get closed as part of the automatic preparation LRU mechanism. If this statement is about to be prepared, but replaces a previous statement which needs to be closed, this holds the name of the previous statement. Otherwise null. Contains the parameter types for a prepared statement, for overloaded cases (same SQL, different param types) Only populated after the statement has been prepared (i.e. null for candidates). The state of a . The statement hasn't been prepared yet, nor is it in the process of being prepared. This is the value for autoprepare candidates which haven't been prepared yet, and is also a temporary state during preparation. The statement has been selected for preparation, but the preparation hasn't started yet. This is a temporary state that only occurs during preparation. Specifically, no protocol message (Parse) has been sent yet. Specifically, it means that a Parse message for the statement has already been written to the write buffer. The statement is in the process of being prepared. This is a temporary state that only occurs during preparation. Specifically, it means that a Parse message for the statement has already been written to the write buffer. The statement has been fully prepared and can be executed. The statement is in the process of being unprepared. This is a temporary state that only occurs during unpreparation. Specifically, it means that a Close message for the statement has already been written to the write buffer. The statement has been unprepared and is no longer usable. Total number of current prepared statements (whether explicit or automatic). The total byte length of the buffer. Used for internal temporary purposes The minimum buffer size possible. Does not perform any I/O - assuming that the bytes to be skipped are in the memory buffer. Seeks the first null terminator (\0) and returns the string up to it. The buffer must already contain the entire string and its terminator. Seeks the first null terminator (\0) and returns the string up to it. The buffer must already contain the entire string and its terminator. Decodes the messages with this encoding. Note that unlike the primitive readers, this reader can read any length, looping internally and reading directly from the underlying stream. output buffer to fill offset in the output buffer in which to start writing number of character to be read into the output buffer number of bytes left in the field. This method will not read bytes beyond this count The number of bytes actually read. The number of characters actually read. the number of bytes read Skips over characters in the buffer, reading from the underlying stream as necessary. the number of characters to skip over. int.MaxValue means all available characters (limited only by ). the maximal number of bytes to process The number of bytes actually skipped. The number of characters actually skipped. the number of bytes read Seeks within the current in-memory data. Does not read any data from the underlying. A copy of corefx's DbColumn, used only in .NET Framework where we don't have it. See https://github.com/dotnet/corefx/blob/master/src/System.Data.Common/src/System/Data/Common/DbColumn.cs Stripped-down version of , mainly to support Amazon Redshift. Performs some post-setup configuration that's common to both table columns and non-columns. Provides schema information about a column. 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. Receives a raw SQL query as passed in by the user, and performs some processing necessary before sending to the backend. This includes doing parameter placebolder processing (@p => $1), and splitting the query up by semicolons if needed (SELECT 1; SELECT 2) Raw user-provided query. Whether the PostgreSQL session is configured to use standard conformant strings. The parameters configured on the of this query. An empty list to be populated with the statements parsed by this method Utility class for temporarily switching implementations. This mechanism is used to temporarily set the current synchronization context to null while executing Npgsql code, making all await continuations execute on the thread pool. This replaces the need to place ConfigureAwait(false) everywhere, and should be used in all surface async methods, without exception. Copied and slightly adjusted from Stephen Cleary's Nito.AsyncEx package (https://github.com/StephenCleary/AsyncEx/blob/master/src/Nito.AsyncEx.Tasks/SynchronizationContextSwitcher.cs) The previous . Initializes a new instance of the class, installing the new . The new . This can be null to remove an existing . Restores the old . Executes a synchronous delegate without the current . The current context is restored when this function returns. The delegate to execute. Executes a synchronous or asynchronous delegate without the current . The current context is restored when this function synchronously returns. The delegate to execute. Utility that simplifies awaiting a task with a timeout. If the given task does not complete within , a is thrown. The task to be awaited How much time to allow to complete before throwing a An awaitable task that represents the original task plus the timeout Utility that simplifies awaiting a task with a timeout. If the given task does not complete within , a is thrown. The task to be awaited How much time to allow to complete before throwing a An awaitable task that represents the original task plus the timeout Allows you to cancel awaiting for a non-cancellable task. Read http://blogs.msdn.com/b/pfxteam/archive/2012/10/05/how-do-i-cancel-non-cancelable-async-operations.aspx and be very careful with this. Allows you to cancel awaiting for a non-cancellable task. Read http://blogs.msdn.com/b/pfxteam/archive/2012/10/05/how-do-i-cancel-non-cancelable-async-operations.aspx and be very careful with this. Creates a new TlsClientStream with the given underlying stream. The handshake must be manually initiated with the method PerformInitialHandshake. Base stream Makes sure there is at least one full record available at _readStart. Also sets _packetLen (does not include packet header of 5 bytes). True on success, false on End Of Stream. Encrypts a record. A header should be at startPos containing TLS record type and version. At startPos + 5 + ivLen the plaintext should start. Should point to the beginning of the record (content type) Plaintext length (without header) The byte position after the last byte in this encrypted record This method checks whether there are at least 1 byte that can be read in the buffer. If not, but there are renegotiation messages in the buffer, these are first processed. This method should be called between each Read and Write to make sure the buffer is empty before writing. Only when this method returns false it is safe to call Write. Whether we should also look in the underlying NetworkStream Whether there is available application data hmac should be initialized with the secret key Reads a value from the buffer, assuming our read position is at the value's preceding length. If the length is -1 (null), this method will return the default value. Creates a type handler for arrays of this handler's type. Creates a type handler for ranges of this handler's type. A type handler may implement ISimpleTypeHandler for types other than its primary one. This is why this method has type parameter T2 and not T. Type handlers that wish to support reading other types in additional to the main one can implement this interface for all those types. A type handler that supports a provider-specific value which is different from the regular value (e.g. NpgsqlDate and DateTime) the regular value type returned by this type handler the type of the provider-specific value returned by this type handler A type handler may implement IChunkingTypeHandler for types other than its primary one. This is why this method has type parameter T2 and not T. Type handlers that wish to support reading other types in additional to the main one can implement this interface for all those types. Implemented by handlers which support , returns a standard TextReader given a binary Stream. Can be thrown by readers to indicate that interpreting the value failed, but the value was read wholly and it is safe to continue reading. Any other exception is assumed to leave the row in an unknown state and the connector is therefore set to Broken. Note that an inner exception is mandatory, and will get thrown to the user instead of the SafeReadException. Maps CLR types to their type handlers. Maps CLR types to their array handlers. A counter that is updated when this registry activates its global mappings. Tracks , allows us to know when a pooled connection's mappings are no longer up to date because a global mapping change has occurred. A counter that is incremented whenever a global mapping change occurs (e.g. , . Caches, for each connection string, the results of the backend type query in the form of a list of type info structs keyed by the PG name. Repeated connections to the same connection string reuse the query results and avoid an additional roundtrip at open-time. Looks up a type handler by its PostgreSQL type's OID. A PostgreSQL type OID A type handler that can be used to encode and decode values. A structure holding information about all PostgreSQL types found in an actual database. Only contains instances and not actual , and is shared between all connections using the same connection string. Consulted when a type handler needs to be created. Indexes backend types by their PostgreSQL name, including namespace (e.g. pg_catalog.int4). Only used for enums and composites. Indexes backend types by their PostgreSQL name, not including namespace. If more than one type exists with the same name (i.e. in different namespaces) this table will contain an entry with a null value. Only used for enums and composites. Clears the internal type cache. Useful for forcing a reload of the types after loading an extension. Clears the internal type cache. Useful for forcing a reload of the types after loading an extension. Base class for all type handlers which handle PostgreSQL arrays. http://www.postgresql.org/docs/current/static/arrays.html The lower bound value sent to the backend when writing arrays. Normally 1 (the PG default) but is 0 for OIDVector. The type of the elements contained within this array The provider-specific type of the elements contained within this array, The type handler for the element that this array type holds http://www.postgresql.org/docs/current/static/arrays.html The .NET type contained as an element within this array The .NET provider-specific type contained as an element within this array The provider-specific type of the elements contained within this array, Handler for the PostgreSQL bit string type. Note that for BIT(1), this handler will return a bool by default, to align with SQLClient (see discussion https://github.com/npgsql/npgsql/pull/362#issuecomment-59622101). http://www.postgresql.org/docs/current/static/datatype-bit.html A special handler for arrays of bit strings. Differs from the standard array handlers in that it returns arrays of bool for BIT(1) and arrays of BitArray otherwise (just like the scalar BitStringHandler does). http://www.postgresql.org/docs/current/static/datatype-boolean.html http://www.postgresql.org/docs/current/static/datatype-binary.html Interface implemented by all concrete handlers which handle enums The CLR type mapped to the PostgreSQL composite type. Type handler for PostgreSQL composite types http://www.postgresql.org/docs/current/static/rowtypes.html Encoding: A 32-bit integer with the number of columns, then for each column: * An OID indicating the type of the column * The length of the column(32-bit integer), or -1 if null * The column data encoded as binary the CLR type to map to the PostgreSQL composite type http://www.postgresql.org/docs/current/static/datatype-datetime.html Whether to convert positive and negative infinity values to DateTime.{Max,Min}Value when a DateTime is requested Copied wholesale from Postgresql backend/utils/adt/datetime.c:j2date http://www.postgresql.org/docs/current/static/datatype-datetime.html A deprecated compile-time option of PostgreSQL switches to a floating-point representation of some date/time fields. Npgsql (currently) does not support this mode. http://www.postgresql.org/docs/current/static/datatype-datetime.html A deprecated compile-time option of PostgreSQL switches to a floating-point representation of some date/time fields. Npgsql (currently) does not support this mode. http://www.postgresql.org/docs/current/static/datatype-datetime.html A deprecated compile-time option of PostgreSQL switches to a floating-point representation of some date/time fields. Npgsql (currently) does not support this mode. Whether to convert positive and negative infinity values to DateTime.{Max,Min}Value when a DateTime is requested http://www.postgresql.org/docs/current/static/datatype-datetime.html http://www.postgresql.org/docs/current/static/datatype-datetime.html Interface implemented by all concrete handlers which handle enums The CLR enum type mapped to the PostgreSQL enum http://www.postgresql.org/docs/current/static/datatype-textsearch.html http://www.postgresql.org/docs/current/static/datatype-textsearch.html Type handler for the PostgreSQL geometric box type. http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric circle type. http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric line type. http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric line segment type. http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric path segment type (open or closed). http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric point type. http://www.postgresql.org/docs/current/static/datatype-geometric.html Type handler for the PostgreSQL geometric polygon type. http://www.postgresql.org/docs/current/static/datatype-geometric.html The text handler to which we delegate encoding/decoding of the actual strings Type handler for the Postgresql "char" type, used only internally http://www.postgresql.org/docs/current/static/datatype-character.html An int2vector is simply a regular array of shorts, with the sole exception that its lower bound must be 0 (we send 1 for regular arrays). An OIDVector is simply a regular array of uints, with the sole exception that its lower bound must be 0 (we send 1 for regular arrays). JSONB binary encoding is a simple UTF8 string, but prepended with a version number. Prepended to the string in the wire encoding http://www.postgresql.org/docs/current/static/datatype-net-types.html http://www.postgresql.org/docs/current/static/datatype-net-types.html http://www.postgresql.org/docs/current/static/datatype-net-types.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-money.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-numeric.html http://www.postgresql.org/docs/current/static/datatype-oid.html Type Handler for the postgis geometry type. Type handler for PostgreSQL range types Introduced in PostgreSQL 9.2. http://www.postgresql.org/docs/current/static/rangetypes.html the range subtype The type handler for the element that this range type holds Type handler for PostgreSQL record types. http://www.postgresql.org/docs/current/static/datatype-pseudo.html Encoding (identical to composite): A 32-bit integer with the number of columns, then for each column: * An OID indicating the type of the column * The length of the column(32-bit integer), or -1 if null * The column data encoded as binary Handles "conversions" for columns sent by the database with unknown OIDs. This differs from TextHandler in that its a text-only handler (we don't want to receive binary representations of the types registered here). Note that this handler is also used in the very initial query that loads the OID mappings (chicken and egg problem). Also used for sending parameters with unknown types (OID=0) http://www.postgresql.org/docs/current/static/datatype-uuid.html http://www.postgresql.org/docs/current/static/datatype-boolean.html Maps an Npgsql type handler to a PostgreSQL type. A PostgreSQL type name as it appears in the pg_type table. A member of which represents this PostgreSQL type. An with set to this value will be sent with the type handler mapped by this attribute. All members of which represent this PostgreSQL type. An with set to one of these values will be sent with the type handler mapped by this attribute. Any .NET type which corresponds to this PostgreSQL type. An with set to one of these values will be sent with the type handler mapped by this attribute. The "primary" which best corresponds to this PostgreSQL type. When or set, will be set to this value. Read-only parameter Returns a string that represents the current object. Note that a connection may be closed before its TransactionScope completes. In this case we close the NpgsqlConnection as usual but the connector in a special list in the pool; it will be closed only when the scope completes. The total byte length of the buffer. The minimum buffer size possible. Returns all contents currently written to the buffer (but not flushed). Useful for pregenerating messages. Represents the date 1970-01-01 Represents the date 0001-01-01 A struct similar to .NET DateTime but capable of storing PostgreSQL's timestamp and timestamptz types. DateTime is capable of storing values from year 1 to 9999 at 100-nanosecond precision, while PostgreSQL's timestamps store values from 4713BC to 5874897AD with 1-microsecond precision. Cast of an to a . An equivalent . Converts the value of the current object to Coordinated Universal Time (UTC). See the MSDN documentation for DateTime.ToUniversalTime(). Note: this method only takes into account the time zone's base offset, and does not respect daylight savings. See https://github.com/npgsql/npgsql/pull/684 for more details. Converts the value of the current object to local time. See the MSDN documentation for DateTime.ToLocalTime(). Note: this method only takes into account the time zone's base offset, and does not respect daylight savings. See https://github.com/npgsql/npgsql/pull/684 for more details. Returns a new that adds the value of the specified TimeSpan to the value of this instance. A positive or negative time interval. An object whose value is the sum of the date and time represented by this instance and the time interval represented by value. Returns a new that adds the value of the specified to the value of this instance. A positive or negative time interval. An object whose value is the sum of the date and time represented by this instance and the time interval represented by value. Returns a new that adds the specified number of years to the value of this instance. A number of years. The value parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and the number of years represented by value. Returns a new that adds the specified number of months to the value of this instance. A number of months. The months parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and months. Returns a new that adds the specified number of days to the value of this instance. A number of whole and fractional days. The value parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and the number of days represented by value. Returns a new that adds the specified number of hours to the value of this instance. A number of whole and fractional hours. The value parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and the number of hours represented by value. Returns a new that adds the specified number of minutes to the value of this instance. A number of whole and fractional minutes. The value parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and the number of minutes represented by value. Returns a new that adds the specified number of minutes to the value of this instance. A number of whole and fractional minutes. The value parameter can be negative or positive. An object whose value is the sum of the date and time represented by this instance and the number of minutes represented by value. Returns a new that adds the specified number of milliseconds to the value of this instance. A number of whole and fractional milliseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer. An object whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by value. Returns a new that adds the specified number of ticks to the value of this instance. A number of 100-nanosecond ticks. The value parameter can be positive or negative. An object whose value is the sum of the date and time represented by this instance and the time represented by value. Implicit cast of a to an A An equivalent . Explicit cast of an to a . An . An equivalent . Represents a PostgreSQL data type that can be written or read to the database. Used in places such as to unambiguously specify how to encode or decode values. See http://www.postgresql.org/docs/current/static/datatype.html Corresponds to the PostgreSQL 8-byte "bigint" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL 8-byte floating-point "double" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL 4-byte "integer" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL arbitrary-precision "numeric" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL floating-point "real" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL 2-byte "smallint" type. See http://www.postgresql.org/docs/current/static/datatype-numeric.html Corresponds to the PostgreSQL "boolean" type. See http://www.postgresql.org/docs/current/static/datatype-boolean.html Corresponds to the PostgreSQL "enum" type. See http://www.postgresql.org/docs/current/static/datatype-enum.html Corresponds to the PostgreSQL geometric "box" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "circle" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "line" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "lseg" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "path" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "point" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL geometric "polygon" type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Corresponds to the PostgreSQL "money" type. See http://www.postgresql.org/docs/current/static/datatype-money.html Corresponds to the PostgreSQL "char(n)"type. See http://www.postgresql.org/docs/current/static/datatype-character.html Corresponds to the PostgreSQL "text" type. See http://www.postgresql.org/docs/current/static/datatype-character.html Corresponds to the PostgreSQL "varchar" type. See http://www.postgresql.org/docs/current/static/datatype-character.html Corresponds to the PostgreSQL internal "name" type. See http://www.postgresql.org/docs/current/static/datatype-character.html Corresponds to the PostgreSQL "citext" type for the citext module. See http://www.postgresql.org/docs/current/static/citext.html Corresponds to the PostgreSQL "char" type. This is an internal field and should normally not be used for regular applications. See http://www.postgresql.org/docs/current/static/datatype-text.html Corresponds to the PostgreSQL "bytea" type, holding a raw byte string. See http://www.postgresql.org/docs/current/static/datatype-binary.html Corresponds to the PostgreSQL "date" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "time" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "timestamp" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "timestamp with time zone" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "interval" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "time with time zone" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the obsolete PostgreSQL "abstime" type. See http://www.postgresql.org/docs/current/static/datatype-datetime.html Corresponds to the PostgreSQL "inet" type. See http://www.postgresql.org/docs/current/static/datatype-net-types.html Corresponds to the PostgreSQL "cidr" type, a field storing an IPv4 or IPv6 network. See http://www.postgresql.org/docs/current/static/datatype-net-types.html Corresponds to the PostgreSQL "macaddr" type, a field storing a 6-byte physical address. See http://www.postgresql.org/docs/current/static/datatype-net-types.html Corresponds to the PostgreSQL "bit" type. See http://www.postgresql.org/docs/current/static/datatype-bit.html Corresponds to the PostgreSQL "varbit" type, a field storing a variable-length string of bits. See http://www.postgresql.org/docs/current/static/datatype-boolean.html Corresponds to the PostgreSQL "tsvector" type. See http://www.postgresql.org/docs/current/static/datatype-textsearch.html Corresponds to the PostgreSQL "tsquery" type. See http://www.postgresql.org/docs/current/static/datatype-textsearch.html Corresponds to the PostgreSQL "uuid" type. See http://www.postgresql.org/docs/current/static/datatype-uuid.html Corresponds to the PostgreSQL "xml" type. See http://www.postgresql.org/docs/current/static/datatype-xml.html Corresponds to the PostgreSQL "json" type, a field storing JSON in text format. See http://www.postgresql.org/docs/current/static/datatype-json.html Corresponds to the PostgreSQL "jsonb" type, a field storing JSON in an optimized binary format. Supported since PostgreSQL 9.4. See http://www.postgresql.org/docs/current/static/datatype-json.html Corresponds to the PostgreSQL "hstore" type, a dictionary of string key-value pairs. See http://www.postgresql.org/docs/current/static/hstore.html Corresponds to the PostgreSQL "array" type, a variable-length multidimensional array of another type. This value must be combined with another value from via a bit OR (e.g. NpgsqlDbType.Array | NpgsqlDbType.Integer) See http://www.postgresql.org/docs/current/static/arrays.html Corresponds to the PostgreSQL "composite" type. See http://www.postgresql.org/docs/current/static/rowtypes.html Corresponds to the PostgreSQL "array" type, a variable-length multidimensional array of another type. This value must be combined with another value from via a bit OR (e.g. NpgsqlDbType.Array | NpgsqlDbType.Integer) Supported since PostgreSQL 9.2. See http://www.postgresql.org/docs/9.2/static/rangetypes.html Corresponds to the PostgreSQL "refcursor" type. Corresponds to the PostgreSQL internal "oidvector" type. See http://www.postgresql.org/docs/current/static/datatype-oid.html Corresponds to the PostgreSQL internal "int2vector" type. Corresponds to the PostgreSQL "oid" type. See http://www.postgresql.org/docs/current/static/datatype-oid.html Corresponds to the PostgreSQL "xid" type, an internal transaction identifier. See http://www.postgresql.org/docs/current/static/datatype-oid.html Corresponds to the PostgreSQL "cid" type, an internal command identifier. See http://www.postgresql.org/docs/current/static/datatype-oid.html Corresponds to the PostgreSQL "regtype" type, a numeric (OID) ID of a type in the pg_type table. Corresponds to the PostgreSQL "tid" type, a tuple id identifying the physical location of a row within its table. A special value that can be used to send parameter values to the database without specifying their type, allowing the database to cast them to another value based on context. The value will be converted to a string and send as text. This value shouldn't ordinarily be used, and makes sense only when sending a data type unsupported by Npgsql. The geometry type for postgresql spatial extension postgis. Represents the PostgreSQL interval datatype. PostgreSQL differs from .NET in how it's interval type doesn't assume 24 hours in a day (to deal with 23- and 25-hour days caused by daylight savings adjustments) and has a concept of months that doesn't exist in .NET's class. (Neither datatype has any concessions for leap-seconds). For most uses just casting to and from TimeSpan will work correctly — in particular, the results of subtracting one or the PostgreSQL date, time and timestamp types from another should be the same whether you do so in .NET or PostgreSQL — but if the handling of days and months in PostgreSQL is important to your application then you should use this class instead of . If you don't know whether these differences are important to your application, they probably arent! Just use and do not use this class directly ☺ To avoid forcing unnecessary provider-specific concerns on users who need not be concerned with them a call to on a field containing an value will return a rather than an . If you need the extra functionality of then use . Represents the number of ticks (100ns periods) in one microsecond. This field is constant. Represents the number of ticks (100ns periods) in one millisecond. This field is constant. Represents the number of ticks (100ns periods) in one second. This field is constant. Represents the number of ticks (100ns periods) in one minute. This field is constant. Represents the number of ticks (100ns periods) in one hour. This field is constant. Represents the number of ticks (100ns periods) in one day. This field is constant. Represents the number of hours in one day (assuming no daylight savings adjustments). This field is constant. Represents the number of days assumed in one month if month justification or unjustifcation is performed. This is set to 30 for consistency with PostgreSQL. Note that this is means that month adjustments cause a year to be taken as 30 × 12 = 360 rather than 356/366 days. Represents the number of ticks (100ns periods) in one day, assuming 30 days per month. Represents the number of months in a year. This field is constant. Represents the maximum . This field is read-only. Represents the minimum . This field is read-only. Represents the zero . This field is read-only. Initializes a new to the specified number of ticks. A time period expressed in 100ns units. Initializes a new to hold the same time as a A time period expressed in a Initializes a new to the specified number of months, days & ticks. Number of months. Number of days. Number of 100ns units. Initializes a new to the specified number of days, hours, minutes & seconds. Number of days. Number of hours. Number of minutes. Number of seconds. Initializes a new to the specified number of days, hours, minutes, seconds & milliseconds. Number of days. Number of hours. Number of minutes. Number of seconds. Number of milliseconds. Initializes a new to the specified number of months, days, hours, minutes, seconds & milliseconds. Number of months. Number of days. Number of hours. Number of minutes. Number of seconds. Number of milliseconds. Initializes a new to the specified number of years, months, days, hours, minutes, seconds & milliseconds. Years are calculated exactly equivalent to 12 months. Number of years. Number of months. Number of days. Number of hours. Number of minutes. Number of seconds. Number of milliseconds. The total number of ticks(100ns units) contained. This is the resolution of the type. This ignores the number of days and months held. If you want them included use first. The resolution of the PostgreSQL interval type is by default 1µs = 1,000 ns. It may be smaller as follows: interval(0) resolution of 1s (1 second) interval(1) resolution of 100ms = 0.1s (100 milliseconds) interval(2) resolution of 10ms = 0.01s (10 milliseconds) interval(3) resolution of 1ms = 0.001s (1 millisecond) interval(4) resolution of 100µs = 0.0001s (100 microseconds) interval(5) resolution of 10µs = 0.00001s (10 microseconds) interval(6) or interval resolution of 1µs = 0.000001s (1 microsecond) As such, if the 100-nanosecond resolution is significant to an application, a PostgreSQL interval will not suffice for those purposes. In more frequent cases though, the resolution of the interval suffices. will always suffice to handle the resolution of any interval value, and upon writing to the database, will be rounded to the resolution used. The number of ticks in the instance. Gets the number of whole microseconds held in the instance. An in the range [-999999, 999999]. Gets the number of whole milliseconds held in the instance. An in the range [-999, 999]. Gets the number of whole seconds held in the instance. An in the range [-59, 59]. Gets the number of whole minutes held in the instance. An in the range [-59, 59]. Gets the number of whole hours held in the instance. Note that this can be less than -23 or greater than 23 unless has been used to produce this instance. Gets the number of days held in the instance. Note that this does not pay attention to a time component with -24 or less hours or 24 or more hours, unless has been called to produce this instance. Gets the number of months held in the instance. Note that this does not pay attention to a day component with -30 or less days or 30 or more days, unless has been called to produce this instance. Returns a representing the time component of the instance. Note that this may have a value beyond the range ±23:59:59.9999999 unless has been called to produce this instance. The total number of ticks (100ns units) in the instance, assuming 24 hours in each day and 30 days in a month. The total number of microseconds in the instance, assuming 24 hours in each day and 30 days in a month. The total number of milliseconds in the instance, assuming 24 hours in each day and 30 days in a month. The total number of seconds in the instance, assuming 24 hours in each day and 30 days in a month. The total number of minutes in the instance, assuming 24 hours in each day and 30 days in a month. The total number of hours in the instance, assuming 24 hours in each day and 30 days in a month. The total number of days in the instance, assuming 24 hours in each day and 30 days in a month. The total number of months in the instance, assuming 24 hours in each day and 30 days in a month. Creates an from a number of ticks. The number of ticks (100ns units) in the interval. A d with the given number of ticks. Creates an from a number of microseconds. The number of microseconds in the interval. A d with the given number of microseconds. Creates an from a number of milliseconds. The number of milliseconds in the interval. A d with the given number of milliseconds. Creates an from a number of seconds. The number of seconds in the interval. A d with the given number of seconds. Creates an from a number of minutes. The number of minutes in the interval. A d with the given number of minutes. Creates an from a number of hours. The number of hours in the interval. A d with the given number of hours. Creates an from a number of days. The number of days in the interval. A d with the given number of days. Creates an from a number of months. The number of months in the interval. A d with the given number of months. Adds another interval to this instance and returns the result. An to add to this instance. An whose values are the sums of the two instances. Subtracts another interval from this instance and returns the result. An to subtract from this instance. An whose values are the differences of the two instances. Returns an whose value is the negated value of this instance. An whose value is the negated value of this instance. This absolute value of this instance. In the case of some, but not all, components being negative, the rules used for justification are used to determine if the instance is positive or negative. An whose value is the absolute value of this instance. Equivalent to PostgreSQL's justify_days function. An based on this one, but with any hours outside of the range [-23, 23] converted into days. Opposite to PostgreSQL's justify_days function. An based on this one, but with any days converted to multiples of ±24hours. Equivalent to PostgreSQL's justify_months function. An based on this one, but with any days outside of the range [-30, 30] converted into months. Opposite to PostgreSQL's justify_months function. An based on this one, but with any months converted to multiples of ±30days. Equivalent to PostgreSQL's justify_interval function. An based on this one, but with any months converted to multiples of ±30days and then with any days converted to multiples of ±24hours Opposite to PostgreSQL's justify_interval function. An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; Produces a canonical NpgslInterval with 0 months and hours in the range of [-23, 23]. While the fact that for many purposes, two different instances could be considered equivalent (e.g. one with 2days, 3hours and one with 1day 27hours) there are different possible canonical forms. E.g. we could move all excess hours into days and all excess days into months and have the most readable form, or we could move everything into the ticks and have the form that allows for the easiest arithmetic) the form chosen has two important properties that make it the best choice. First, it is closest two how objects are most often represented. Second, it is compatible with results of many PostgreSQL functions, particularly with age() and the results of subtracting one date, time or timestamp from another. Note that the results of casting a to is canonicalised. An based on this one, but with months converted to multiples of ±30days and with any hours outside of the range [-23, 23] converted into days. Implicit cast of a to an A An eqivalent, canonical, . Casts a to an . Explicit cast of an to a . A . An equivalent . Casts an to a . Returns true if another is exactly the same as this instance. An for comparison. true if the two instances are exactly the same, false otherwise. Returns true if another object is an , that is exactly the same as this instance An for comparison. true if the argument is an and is exactly the same as this one, false otherwise. Compares two instances. The first . The second . 0 if the two are equal or equivalent. A value greater than zero if x is greater than y, a value less than zero if x is less than y. A hash code suitable for uses with hashing algorithms. An signed integer. Compares this instance with another/ An to compare this with. 0 if the instances are equal or equivalent. A value less than zero if this instance is less than the argument. A value greater than zero if this instance is greater than the instance. Compares this instance with another/ An object to compare this with. 0 if the argument is an and the instances are equal or equivalent. A value less than zero if the argument is an and this instance is less than the argument. A value greater than zero if the argument is an and this instance is greater than the instance. A value greater than zero if the argument is null. The argument is not an . Parses a and returns a instance. Designed to use the formats generally returned by PostgreSQL. The to parse. An represented by the argument. The string was null. A value obtained from parsing the string exceeded the values allowed for the relevant component. The string was not in a format that could be parsed to produce an . Attempt to parse a to produce an . The to parse. (out) The produced, or if the parsing failed. true if the parsing succeeded, false otherwise. Create a representation of the instance. The format returned is of the form: [M mon[s]] [d day[s]] [HH:mm:ss[.f[f[f[f[f[f[f[f[f]]]]]]]]]] A zero is represented as 00:00:00 Ticks are 100ns, Postgress resolution is only to 1µs at most. Hence we lose 1 or more decimal precision in storing values in the database. Despite this, this method will output that extra digit of precision. It's forward-compatible with any future increases in resolution up to 100ns, and also makes this ToString() more applicable to any other use-case. The representation. Adds two together. The first to add. The second to add. An whose values are the sum of the arguments. Subtracts one from another. The to subtract the other from. The to subtract from the other. An whose values are the difference of the arguments Returns true if two are exactly the same. The first to compare. The second to compare. true if the two arguments are exactly the same, false otherwise. Returns false if two are exactly the same. The first to compare. The second to compare. false if the two arguments are exactly the same, true otherwise. Compares two instances to see if the first is less than the second The first to compare. The second to compare. true if the first is less than second, false otherwise. Compares two instances to see if the first is less than or equivalent to the second The first to compare. The second to compare. true if the first is less than or equivalent to second, false otherwise. Compares two instances to see if the first is greater than the second The first to compare. The second to compare. true if the first is greater than second, false otherwise. Compares two instances to see if the first is greater than or equivalent the second The first to compare. The second to compare. true if the first is greater than or equivalent to the second, false otherwise. Returns the instance. Returns the instance. Negates an instance. An . The negation of the argument. Represents a PostgreSQL tsquery. This is the base class for lexeme, not, and and or nodes. Node kind NodeKind Lexeme Not operator And operator Or operator Represents the empty tsquery. Should only be used at top level. Writes the tsquery in PostgreSQL's text format. Parses a tsquery in PostgreSQL's text format. TsQuery Lexeme node. Lexeme text. Weights is a bitmask of the Weight enum. Prefix search. Creates a tsquery lexeme with only lexeme text. Lexeme text. Creates a tsquery lexeme with lexeme text and weights. Lexeme text. Bitmask of enum Weight. Creates a tsquery lexeme with lexeme text, weights and prefix search flag. Lexeme text. Bitmask of enum Weight. Is prefix search? Weight enum, can be OR'ed together. None D C B A TsQuery Not node. Child node Creates a not operator, with a given child node. Base class for TsQuery binary operators (& and |). Left child Right child TsQuery And node. Creates an and operator, with two given child nodes. TsQuery Or Node. Creates an or operator, with two given child nodes. Represents an empty tsquery. Shold only be used as top node. Creates a tsquery that represents an empty query. Should not be used as child node. Represents a PostgreSQL tsvector. Constructs an NpgsqlTsVector from a list of lexemes. This also sorts and remove duplicates. Parses a tsvector in PostgreSQL's text format. Returns the lexeme at a specific index Gets the number of lexemes. Returns an enumerator. Returns an enumerator. Gets a string representation in PostgreSQL's format. Represents a lexeme. A lexeme consists of a text string and optional word entry positions. Gets or sets the text. Creates a lexeme with no word entry positions. Creates a lexeme with word entry positions. Gets a word entry position. Gets the number of word entry positions. Creates a string representation in PostgreSQL's format. Represents a word entry position and an optional weight. Creates a WordEntryPos with a given position and weight. Position values can range from 1 to 16383; larger numbers are silently set to 16383. A weight labeled between A and D. The weight is labeled from A to D. D is the default, and not printed. The position is a 14-bit unsigned integer indicating the position in the text this lexeme occurs. Cannot be 0. Prints this lexeme in PostgreSQL's format, i.e. position is followed by weight (weight is only printed if A, B or C). Determines whether the specified object is equal to the current object. Determines whether the specified object is equal to the current object. Gets a hash code for the current object. Determines whether the specified object is equal to the current object. Determines whether the specified object is unequal to the current object. The weight is labeled from A to D. D is the default, and not printed. D, the default C B A Determines whether the specified object is equal to the current object. Determines whether the specified object is equal to the current object. Gets a hash code for the current object. Determines whether the specified object is equal to the current object. Determines whether the specified object is unequal to the current object. Represents a PostgreSQL point type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Represents a PostgreSQL line type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Represents a PostgreSQL Line Segment type. Represents a PostgreSQL box type. See http://www.postgresql.org/docs/current/static/datatype-geometric.html Represents a PostgreSQL Path type. Represents a PostgreSQL Polygon type. Represents a PostgreSQL Circle type. Represents a PostgreSQL inet type, which is a combination of an IPAddress and a subnet mask. http://www.postgresql.org/docs/current/static/datatype-net-types.html Represents a PostgreSQL tid value http://www.postgresql.org/docs/current/static/datatype-oid.html Block number Tuple index within block Indicates that this property or field correspond to a PostgreSQL field with the specified name The name of PostgreSQL field that corresponds to this CLR property or field Indicates that this property or field correspond to a PostgreSQL field with the specified name The name of PostgreSQL field that corresponds to this CLR property or field Represents the identifier of the Well Known Binary representation of a geographical feature specified by the OGC. http://portal.opengeospatial.org/files/?artifact_id=13227 Chapter 6.3.2.7 The modifiers used by postgis to extend the geomtry's binary representation A structure representing a 2D double precision floating point coordinate; X coordinate. Y coordinate. Generates a new BBpoint with the specified coordinates. X coordinate Y coordinate Represents an Postgis feature. returns the binary length of the data structure without header. The Spatial Reference System Identifier of the geometry (0 if unspecified). Represents an Postgis 2D Point Represents an Ogc 2D LineString Represents an Postgis 2D Polygon. Represents a Postgis 2D MultiPoint Represents a Postgis 2D MultiLineString Represents a Postgis 2D MultiPolygon. Represents a collection of Postgis feature. Indicates that the value of the marked element could be null sometimes, so the check for null is necessary before its usage. [CanBeNull] public object Test() { return null; } public void UseTest() { var p = Test(); var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' } Indicates that the value of the marked element could never be null. [NotNull] public object Foo() { return null; // Warning: Possible 'null' assignment } Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task and Lazy classes to indicate that the value of a collection item, of the Task.Result property or of the Lazy.Value property can never be null. Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task and Lazy classes to indicate that the value of a collection item, of the Task.Result property or of the Lazy.Value property can be null. Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), so this symbol will not be marked as unused (as well as by other usage inspections). Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes as unused (as well as by other usage inspections) Only entity marked with attribute considered used. Indicates implicit assignment to a member. Indicates implicit instantiation of a type with fixed constructor signature. That means any unused constructor parameters won't be reported as such. Indicates implicit instantiation of a type. Specify what is considered used implicitly when marked with or . Members of entity marked with attribute are considered used. Entity marked with attribute and all its members considered used. This attribute is intended to mark publicly available API which should not be removed and so is treated as used. Describes dependency between method input and output.

Function Definition Table syntax:

FDT ::= FDTRow [;FDTRow]* FDTRow ::= Input => Output | Output <= Input Input ::= ParameterName: Value [, Input]* Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} Value ::= true | false | null | notnull | canbenull If method has single input parameter, it's name could be omitted.
Using halt (or void/nothing, which is the same) for method output means that the methos doesn't return normally.
canbenull annotation is only applicable for output parameters.
You can use multiple [ContractAnnotation] for each FDT row, or use single attribute with rows separated by semicolon.
[ContractAnnotation("=> halt")] public void TerminationMethod() [ContractAnnotation("halt <= condition: false")] public void Assert(bool condition, string text) // regular assertion method [ContractAnnotation("s:null => true")] public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() // A method that returns null if the parameter is null, // and not null if the parameter is not null [ContractAnnotation("null => null; notnull => notnull")] public object Transform(object data) [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] public bool TryParse(string s, out Person result)
Indicates that the function argument should be string literal and match one of the parameters of the caller function. For example, ReSharper annotates the parameter of . public void Foo(string param) { if (param == null) throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol } Indicates that IEnumerable, passed as parameter, is not enumerated.