Npgsql Base class for all classes which represent a message sent by the PostgreSQL backend. 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 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. Base class for all classes which represent a message sent to the PostgreSQL backend. Writes the message contents into the buffer. Returns the number of bytes needed to write this 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. Consumes the current row asynchronously, 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. 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. 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. An logging provider that outputs Npgsql logging messages to standard error. Used to create logger instances of the given name. Creates a new INpgsqlLogger instance of the given name. 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. 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. Large object manager. This class can be used to store very large files in a PostgreSQL database. Large object manager. This class can be used to store very large files in a PostgreSQL database. 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 NpgsqlException 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 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. Note that this method, as well as operations on the stream must be wrapped inside a transaction. Oid of the object An NpgsqlLargeObjectStream Deletes a large object on the backend. Oid of the object to delete 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 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 The largest chunk size (in bytes) read and write operations will read/write each roundtrip to the network. Default 4 MB. 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. 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. 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. 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. 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. 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. 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. 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. 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. Provides an API for a binary COPY TO operation, a high-performance data export mechanism from a PostgreSQL table. Initiated by 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 Skips the current column without interpreting its value. Cancels an ongoing export. Completes that binary export and sets the connection back to idle state The number of columns, as returned from the backend in the CopyInResponse. Returns whether the current column is null. 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. 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. The number of columns, as returned from the backend in the CopyInResponse. 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 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. Provides data for a notice event. The Notice that was sent from the database. 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. 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 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 Represents an arbitrary-length message capable of flushing the buffer internally as it's writing itself out. the buffer into which to write the message. an option buffer that, if returned, will be written to the server directly, bypassing our NpgsqlBuffer. This is an optimization hack for bytea. 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. 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). A simple query message. Note that since this is only used to send some specific control messages (e.g. start transaction) and never arbitrary-length user-provided queries, this message is treated as simple and not chunking, and only ASCII is supported. 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 The query string to be parsed. The name of the destination prepared statement (an empty string selects the unnamed prepared statement). 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. The minimum buffer size possible. Used for internal temporary purposes Reads in the requested bytes into the buffer, or if the buffer isn't big enough, allocates a new temporary buffer and reads into it. Returns the buffer that contains the data (either itself or the temp buffer). Used in cases where we absolutely have to have an entire value in memory and cannot read it in sequentially. 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. The total byte length of the buffer. During copy operations, the buffer's usable size is smaller than its total size because of the CopyData message header. This distinction is important since some type handlers check how much space is left in the buffer in their decision making. 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 RowDescription message for this query. If null, the query does not return rows (e.g. INSERT) For prepared statements, holds the server-side prepared statement name. Returns the SQL text of the statement. 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. 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. 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, . Explicit cast of an to a . A . An equivalent . 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. An . The argument. Negates an instance. An . The negation of the argument. 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. 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. 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 . Cast of an to a . An equivalent . Represents a PostgreSQL tsquery. This is the base class for lexeme, not, and and or nodes. Writes the tsquery in PostgreSQL's text format. Parses a tsquery in PostgreSQL's text format. Node kind NodeKind Lexeme Not operator And operator Or operator Represents the empty tsquery. Should only be used at top level. TsQuery Lexeme node. 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? Lexeme text. Weights is a bitmask of the Weight enum. Prefix search. Weight enum, can be OR'ed together. None D C B A TsQuery Not node. Creates a not operator, with a given child node. 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 an enumerator. Returns an enumerator. Gets a string representation in PostgreSQL's format. Returns the lexeme at a specific index Gets the number of lexemes. Represents a lexeme. A lexeme consists of a text string and optional word entry positions. Creates a lexeme with no word entry positions. Creates a lexeme with word entry positions. Creates a string representation in PostgreSQL's format. Gets or sets the text. Gets a word entry position. Gets the number of word entry positions. 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. Prints this lexeme in PostgreSQL's format, i.e. position is followed by weight (weight is only printed if A, B or C). 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. The weight is labeled from A to D. D is the default, and not printed. D, the default C B A Indicates that the PostgreSQL enum value differs from the .NET value. Indicates that the PostgreSQL enum value differs from the .NET value. What label to use instead. The database label that corresponds to the .NET enum value on which this attribute is placed. 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 queries parsed by this method 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 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 type handler which handles values of totally arbitrary length, and therefore supports chunking them. the value to be examined a cache in which to store length(s) of values to be written the containing . Consulted for settings which impact how to send the parameter, e.g. . Can be null. the value to be written a cache in which to store length(s) of values to be written the containing . Consulted for settings which impact how to send the parameter, e.g. . Can be null. . A handler which can read small, usually fixed-length values. the type of the value returned by this type handler The entire data required to read the value is expected to be in the buffer. Reads a BitArray from a binary PostgreSQL value. First 32-bit big endian length, then the data in big-endian. Zero-padded low bits in the end if length is not multiple of 8. 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). Base class for all type handlers which handle PostgreSQL arrays. http://www.postgresql.org/docs/current/static/arrays.html Optimized population for one-dimensional arrays without boxing/unboxing Recursively populates an array from PB binary data representation. The lower bound value sent to the backend when writing arrays. Normally 1 (the PG default) but is 0 for OIDVector. The type handler for the element that this array type holds 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 line 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 polygon 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 line segment type. 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 The text handler to which we delegate encoding/decoding of the actual strings 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). http://www.postgresql.org/docs/current/static/arrays.html The .NET type contained as an element within this array The type of the elements contained within this array The provider-specific type of the elements contained within this array, JSONB binary encoding is a simple UTF8 string, but prepended with a version number. Implemented by handlers which support , returns a standard TextReader given a binary Stream. Prepended to the string in the wire encoding Indicates whether the prepended version byte has already been read or written The text handler which does most of the encoding/decoding work. 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 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 marking interface to allow us to know whether a given type handler has a provider-specific type distinct from its regular type Type handler for the Postgresql "char" type, used only internally http://www.postgresql.org/docs/current/static/datatype-character.html Represents the date 1970-01-01 Represents the date 0001-01-01 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 "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. 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. 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 SQL statement or function (stored procedure) to execute against a PostgreSQL database. This class cannot be inherited. Specifies the maximum number of queries we allow in a multiquery, separated by semicolons. We limit this because of deadlocks: as we send Parse and Bind messages to the backend, the backend replies with ParseComplete and BindComplete messages which we do not read until we finished sending all messages. Once our buffer gets full the backend will get stuck writing, and then so will we. Cached version of _connection.Connector, for performance Indicates whether this command has been prepared. Never access this field directly, use instead. For prepared commands, captures the connection's at the time the command was prepared. This allows us to know whether the connection was closed since the command was prepared. 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. Creates a new instance of an DbParameter object. An DbParameter object. Creates a new instance of a NpgsqlParameter object. A NpgsqlParameter object. Creates a prepared version of the command on a PostgreSQL server. 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. 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 we send the Describe command right after the Parse and before the Bind, 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. 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 Update method of the DbDataAdapter. 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 DB parameter collection. Gets the NpgsqlParameterCollection. The parameters of the SQL statement or function (stored procedure). The default is an empty collection. DB transaction. Gets or sets the NpgsqlTransaction within which the NpgsqlCommand executes. The NpgsqlTransaction. The default value is a null reference. 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. 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 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 class represents a connection to a PostgreSQL server. The default TCP/IP port for PostgreSQL. Maximum value for connection timeout. The actual string provided by the user for the connection string Initializes a new instance of the NpgsqlConnection class. Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString. The connection used to open the PostgreSQL database. Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString. The connection used to open the PostgreSQL database. Opens a database connection with the property settings specified by the ConnectionString. 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. 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. When a connection is closed within an enclosing TransactionScope and the transaction hasn't been promoted, we defer the actual closing until the scope ends. 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. 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 STDIN operation, a high-performance data export mechanism from a PostgreSQL table. A COPY TO STDIN 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 FROM STDIN operation, a data import mechanism to a PostgreSQL table. It is the user's responsibility to parse the textual input according to the format specified in . A COPY TO STDIN 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 or FROM), 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 FROM STDIN or COPY TO 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. Registers an enum type for use with this connection. Enum labels are mapped by string. The .NET enum labels must correspond exactly to the PostgreSQL labels; if another label is used in the database, this can be specified for each label with a EnumLabelAttribute. 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 registration is lost. To avoid registering the type for each connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the .NET type's name in lowercase will be used The .NET enum type to be registered Registers an enum type for use with all connections created from now on. Existing connections aren't affected. Enum labels are mapped by string. The .NET enum labels must correspond exactly to the PostgreSQL labels; if another label is used in the database, this can be specified for each label with a EnumLabelAttribute. If there is a discrepancy between the .NET and database labels while an enum is read or written, an exception will be raised. To register the type for a specific connection, use the method. A PostgreSQL type name for the corresponding enum type in the database. If null, the .NET type's name in lowercase will be used The .NET enum type to be associated 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. 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. Clear connection pool. Clear all connection pools. Flushes the type cache for this connection's connection string and reloads the types for this connection only. The parsed connection string set by the user The connector object connected to the backend. A counter that gets incremented every time the connection is (re-)opened. This allows us to identify an "instance" of connection, which is useful since some resources are released when a connection is closed (e.g. prepared statements). 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 time to wait before closing unused connections in the pool if the count of all connections exeeds MinPoolSize. If connection pool contains unused connections for ConnectionLifeTime seconds, the half of them will be closed. If there will be unused connections in a second later then again the half of them will be closed and so on. This strategy provide smooth change of connection count in the pool. The time (in seconds) to wait. The default value is 15 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) Gets flag indicating if we are using Synchronous notification or not. The default value is false. Whether to use Windows integrated security to log in. User name. Determine if connection pooling will be used for this connection. 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 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). Report whether the backend understands the hex byte format (>= 9.0). DB provider factory. 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 . 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. 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. 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. No integrated security if we're on mono and .NET 4.5 because of ClaimsIdentity, see https://github.com/npgsql/Npgsql/issues/133 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. 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. Controls whether SSL is required, disabled or preferred, depending on server support. Whether to trust the server certificate without validating it. 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. Whether connection pooling should be used. The minimum connection pool size. The maximum connection pool size. The time to wait before closing unused connections in the pool if the count of all connections exeeds MinPoolSize. If connection pool contains unused connections for ConnectionLifeTime seconds, the half of them will be closed. If there will be unused connections in a second later then again the half of them will be closed and so on. This strategy provide smooth change of connection count in the pool. The time (in seconds) to wait. The default value is 15 seconds. 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. Whether to have the backend enforce and via the statement_timeout variable. Defaults to true. 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. Whether to process messages that arrive between command activity. The number of seconds of connection inactivity before Npgsql sends a keepalive query. Set to 0 (the default) to disable. Gets or sets the buffer size. A compatibility mode for special PostgreSQL server types. Makes MaxValue and MinValue timestamps and dates readable as infinity and negative infinity. Obsolete, see https://github.com/npgsql/Npgsql/wiki/PreloadReader-Removal Obsolete, see https://github.com/npgsql/Npgsql/wiki/UseExtendedTypes-Removal 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. 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. Number of seconds added as a margin to the backend timeout to yield the frontend timeout. We prefer the backend to timeout - it's a clean error which doesn't break the connector. The minimum timeout that can be set on internal commands such as COMMIT, ROLLBACK. 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. The secret key of the backend for this connector, used for query cancellation. 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 The number of messages that were prepended and sent to the last message chain. Note that this only tracks messages which produce a ReadyForQuery message A chain of messages to be sent to the backend. 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) Contains the current value of the statement_timeout parameter at the backend, used to determine whether we need to change it when commands are sent. 0 means means no timeout. -1 means that the current value is unknown. 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 non-user-triggered async action is in progress, e.g. handling of an asynchronous notification or a connection keepalive. Does not get taken for a user async action such as . 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. Creates a new connector with the given connection string. The connection string. 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. Sends a single frontend message, used for simple messages such as rollback, etc. Note that additional prepend messages may be previously enqueued, and will be sent along with this message. Given a user timeout in seconds, sets the socket's ReceiveTimeout (if needed). Note that if backend timeouts are enabled, we add a few seconds of margin to allow the backend timeout to happen first. Reads and processes any messages that are already in our buffers (either Npgsql or TCP). Handles asynchronous messages (Notification, Notice, ParameterStatus) that may after a ReadyForQuery, as well as async notification mode. 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 Creates another connector and sends a cancel request through it for this connector. Closes the physical connection to the server. 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. Called when an open attempt fails (e.g. I/O error, timeout). 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 This method is required to set all the version dependent features flags. SupportsPrepare means the server can use prepared query plans (7.3+) Called in various cases to indicate that the backend's statement_timeout parameter may have changed and is currently unknown. It will be set the next time a command is sent. Returns next portal index. Returns next plan index. Buffer used for reading data. Version of backend server this connector is connected to. 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 frontend timeout for reading messages that are part of the user's command (i.e. which aren't internal prepended commands). Gets the current state of the connector Returns whether the connector is open, regardless of any task it is currently performing Returns whether the connector is open and performing a task, i.e. not ready for a query Occurs on NoticeResponses from the PostgreSQL backend. Occurs on NotificationResponses from the PostgreSQL backend. Returns whether SSL is being used for the connection Represents the method that allows the application to provide a certificate collection to be used for SSL client authentication Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication. See Whether the backend is an AWS Redshift instance An IDisposable wrapper around and . 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 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 This class manages all connector objects, pooled AND non-pooled. Maximum number of possible connections in the pool. Unique static instance of the connector pool mamager. Map of index to unused pooled connectors, avaliable to the next RequestConnector() call. This hashmap will be indexed by connection string. This key will hold a list of queues of pooled connectors available to be used. Searches the pooled connector lists for a matching connector object or creates a new one. The NpgsqlConnection that is requesting the connector. Its ConnectionString will be used to search the pool for available connectors. A connector object. Find an available pooled connector in the pool, or create a new one if none found. Releases a connector, possibly back to the pool for future use. Pooled connectors will be put back into the pool if there is room. Connection to which the connector is leased. The connector to release. A queue with an extra Int32 for keeping track of busy connections. Connections available to the end user Connections currently in use 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. Default constructor. Constructor. Constructor. Constructor. Create row updated event. Create row updating event. Raise the RowUpdated event. Raise the RowUpdating event. Row updated event. Row updating event. Delete command. Select command. Update command. Insert command. Reads a forward-only stream of rows from a data source. 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(). If has been called, its results are cached here. In non-sequential mode, contains the cached values already read from the current row 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 the name of the column, given the zero-based column ordinal. The zero-based column ordinal. The name of the specified column. Consumes all result sets for this reader, leaving the connector ready for sending and processing further queries Closes the object. 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 , 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. 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. 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 column ordinal given the name of the column. The name of the column. The zero-based column ordinal. 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 a System.Data.DataTable that describes the column metadata of the DataReader. Is raised whenever Close() is called. 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 number of columns in the current row. Returns the current row, or throws an exception if a row isn't available 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 instance of . The name of the column. The value of the specified column. Contains the column names as the keys Contains all unique columns The exception that is thrown when the PostgreSQL backend reports errors. Note that other errors (network issues, Npgsql client-side problems) are reported as regular .NET exceptions. See http://www.postgresql.org/docs/current/static/errcodes-appendix.html, http://www.postgresql.org/docs/current/static/protocol-error-fields.html Populates a with the data needed to serialize the target object. The to populate with data. The destination (see ) for this serialization. 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 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. Same as , for backwards-compatibility with Npgsql 2.x Gets a the PostgreSQL error message and code. Gets a collection of key/value pairs that provide additional PostgreSQL fields about the exception. A factory to create instances of various Npgsql objects. Creates an NpgsqlCommand object. Specifies the type of SQL statement, e.g. SELECT EventArgs class to send Notification parameters. Process ID of the PostgreSQL backend that sent this notification. Condition that triggered that notification. Additional information. This class represents a parameter to a command that will be sent to server 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. Reset DBType. Creates a new NpgsqlParameter that is a copy of the current instance. A new NpgsqlParameter that is a copy of this instance. Can be used to communicate a value from the validation phase to the writing phase. 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. 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) 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. 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 and value. The name of the NpgsqlParameter. The Value of the NpgsqlParameter to add to the collection. One of the NpgsqlDbType values. 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 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. 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. 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. 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. In methods taking an object as argument this method is used to verify that the argument has the type NpgsqlParameter The object to verify 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[] 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. Report whether the collection is read only. Always false. 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. Sync root. Used when a connection is closed 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. Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. Commits the database transaction. 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. Creates a transaction save point. Rolls back a transaction from a pending savepoint state. Rolls back a transaction from a pending savepoint state. Dispose. Specifies the object associated with the transaction. The object associated with 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. This method takes a version string as returned by SELECT VERSION() and returns a valid version string ("7.2.2" for example). This is only needed when running protocol version 2. This does not do any validity checks. Write a 32-bit integer to the given stream in the correct byte order. Creates a Task<TResult> that's completed successfully with the specified result. In .NET 4.5 Task provides this. In .NET 4.0 with BCL.Async, TaskEx provides this. This method wraps the two. The type of the result returned by the task. The result to store into the completed task. The successfully completed task. Throws an exception with the given string and also invokes a contract failure, allowing the static checker to detect scenarios leading up to this error. See http://blogs.msdn.com/b/francesco/archive/2014/09/12/how-to-use-cccheck-to-prove-no-case-is-forgotten.aspx the exception message an exception to be thrown Represent the frontend/backend protocol version. Protocol version 3 (the current version). A class to handle everything associated with SSPI authentication Simplified SecBufferDesc struct with only one SecBuffer 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, http://www.postgresql.org/docs/current/static/datatype-oid.html 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 http://www.postgresql.org/docs/current/static/datatype-uuid.html http://www.postgresql.org/docs/current/static/datatype-money.html http://www.postgresql.org/docs/current/static/datatype-datetime.html 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 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 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-numeric.html http://www.postgresql.org/docs/current/static/datatype-boolean.html http://www.postgresql.org/docs/current/static/datatype-binary.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 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 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 http://www.postgresql.org/docs/current/static/datatype-numeric.html 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. 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. 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. Returns a string that represents the current object. Specifies the type of a type, as represented in the PostgreSQL typtype column of the pg_type table. See http://www.postgresql.org/docs/current/static/catalog-pg-type.html 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)