Reference¶
postgresql
¶
py-postgresql is a Python package for using PostgreSQL. This includes low-level protocol tools, a driver(PG-API and DB-API 2.0), and cluster management tools.
See <http://postgresql.org> for more information about PostgreSQL and <http://python.org> for information about Python.
-
postgresql.
version
= '1.2.1'¶ The version string of py-postgresql.
-
postgresql.
version_info
= (1, 2, 1)¶ The version triple of py-postgresql: (major, minor, patch).
-
postgresql.
open
(iri=None, prompt_title=None, **kw)[source]¶ Create a postgresql.api.Connection to the server referenced by the given iri:
>>> import postgresql # General Format: >>> db = postgresql.open('pq://user:password@host:port/database') # Connect to 'postgres' at localhost. >>> db = postgresql.open('localhost/postgres')
Connection keywords can also be used with open. See the narratives for more information.
The prompt_title keyword is ignored. open will never prompt for the password unless it is explicitly instructed to do so.
(Note: “pq” is the name of the protocol used to communicate with PostgreSQL)
postgresql.api
¶
Application Programmer Interfaces for PostgreSQL.
postgresql.api
is a collection of Python APIs for the PostgreSQL DBMS. It
is designed to take full advantage of PostgreSQL’s features to provide the
Python programmer with substantial convenience.
This module is used to define “PG-API”. It creates a set of ABCs that makes up the basic interfaces used to work with a PostgreSQL server.
-
class
postgresql.api.
Category
[source]¶ Bases:
postgresql.python.element.Element
A category is an object that initializes the subject connection for a specific purpose.
Arguably, a runtime class for use with connections.
-
class
postgresql.api.
Chunks
[source]¶ Bases:
postgresql.api.Result
,collections.abc.Iterator
,collections.abc.Iterable
-
class
postgresql.api.
Cluster
[source]¶ Bases:
postgresql.python.element.Element
Interface to a PostgreSQL cluster–a data directory. An implementation of this provides a means to control a server.
-
abstract property
data_directory
¶ The path to the data directory of the cluster.
-
abstract
init
(initdb: path to the initdb to use = None, user: name of the cluster's superuser = None, password: superuser's password = None, encoding: the encoding to use for the cluster = None, locale: the locale to use for the cluster = None, collate: the collation to use for the cluster = None, ctype: the ctype to use for the cluster = None, monetary: the monetary to use for the cluster = None, numeric: the numeric to use for the cluster = None, time: the time to use for the cluster = None, text_search_config: default text search configuration = None, xlogdir: location for the transaction log directory = None)[source]¶ Create the cluster at the data_directory associated with the Cluster instance.
-
abstract property
installation
¶ The installation used by the cluster.
-
abstract property
settings
¶ A Settings interface to the
postgresql.conf
file associated with the cluster.
-
abstract
wait_until_started
(timeout: maximum time to wait = 10)[source]¶ After the start() method is ran, the database may not be ready for use. This method provides a mechanism to block until the cluster is ready for use.
If the timeout is reached, the method must throw a postgresql.exceptions.ClusterTimeoutError.
-
abstract
wait_until_stopped
(timeout: maximum time to wait = 10)[source]¶ After the stop() method is ran, the database may still be running. This method provides a mechanism to block until the cluster is completely shutdown.
If the timeout is reached, the method must throw a postgresql.exceptions.ClusterTimeoutError.
-
abstract property
-
class
postgresql.api.
Connection
[source]¶ Bases:
postgresql.api.Database
The interface to a connection to a PostgreSQL database. This is a Database interface with the additional connection management tools that are particular to using a remote database.
-
abstract
clone
() → postgresql.api.Connection[source]¶ Create another connection using the same factors as self. The returned object should be open and ready for use.
-
abstract
close
() → None[source]¶ Close the connection.
Does nothing if the connection is already closed.
-
abstract property
closed
¶ True if the Connection is closed, False if the Connection is open.
>>> db.closed True
-
abstract
connect
() → None[source]¶ Establish the connection to the server and initialize the category.
Does nothing if the connection is already established.
-
abstract property
connector
¶ The
Connector
instance facilitating the Connection object’s communication and initialization.
-
abstract property
query
¶ The
Execution
instance providing a one-shot query interface:connection.query.<method>(sql, *parameters) == connection.prepare(sql).<method>(*parameters)
-
abstract
-
class
postgresql.api.
Connector
(user: required keyword specifying the user name(str) = None, password: str = None, database: str = None, settings: (<class 'dict'>, [(<class 'str'>, <class 'str'>)]) = None, category: postgresql.api.Category = None)[source]¶ Bases:
postgresql.python.element.Element
A connector is an object providing the necessary information to establish a connection. This includes credentials, database settings, and many times addressing information.
-
class
postgresql.api.
Cursor
[source]¶ Bases:
postgresql.api.Result
,collections.abc.Iterator
,collections.abc.Iterable
A Cursor object is an interface to a sequence of tuples(rows). A result set. Cursors publish a file-like interface for reading tuples from a cursor declared on the database.
Cursor objects are created by invoking the Statement.declare method or by opening a cursor using an identifier via the Database.cursor_from_id method.
-
abstract
clone
() → postgresql.api.Cursor[source]¶ Create a new cursor using the same factors as self.
-
abstract property
direction
¶ The default direction argument for read().
When True reads are FORWARD. When False reads are BACKWARD.
Cursor operation option.
-
abstract
read
(quantity: Number of rows to read = None, direction: Direction to fetch in, defaults to `self.direction` = None) → [Row][source]¶ Read, fetch, the specified number of rows and return them in a list. If quantity is None, all records will be fetched.
direction can be used to override the default configured direction.
This alters the cursor’s position.
Read does not directly correlate to FETCH. If zero is given as the quantity, an empty sequence must be returned.
-
abstract
seek
(offset, whence='ABSOLUTE')[source]¶ Set the cursor’s position to the given offset with respect to the whence parameter and the configured direction.
Whence values:
0
or"ABSOLUTE"
Absolute.
1
or"RELATIVE"
Relative.
2
or"FROM_END"
Absolute from end.
3
or"FORWARD"
Relative forward.
4
or"BACKWARD"
Relative backward.
Direction effects whence. If direction is BACKWARD, ABSOLUTE positioning will effectively be FROM_END, RELATIVE’s position will be negated, and FROM_END will effectively be ABSOLUTE.
-
abstract
-
class
postgresql.api.
Database
[source]¶ Bases:
postgresql.python.element.Element
The interface to an individual database. Connection objects inherit from this
-
abstract property
backend_id
¶ The backend’s process identifier.
-
abstract property
client_address
¶ The client address that the server sees. This is obtainable by querying the
pg_catalog.pg_stat_activity
relation.None if unavailable.
-
abstract property
client_port
¶ The client port that the server sees. This is obtainable by querying the
pg_catalog.pg_stat_activity
relation.None if unavailable.
-
abstract
cursor_from_id
(cursor_id: The cursor's identification string.) → postgresql.api.Cursor[source]¶ Create a Cursor object from the given cursor_id that was already declared on the server.
Cursor objects created this way must not be closed when the object is garbage collected. Rather, the user must explicitly close it for the server resources to be released. This is in contrast to Cursor objects that are created by invoking a Statement or a SRF StoredProcedure.
-
abstract
do
(source) → None[source]¶ Execute a DO statement using the given language and source. Always returns None.
Likely to be a function of Connection.execute.
-
abstract
execute
() → None[source]¶ Execute an arbitrary block of SQL. Always returns None and raise an exception on error.
-
abstract
iternotifies
(timeout=None) → collections.abc.Iterator[source]¶ Return an iterator to the notifications received by the connection. The iterator must produce triples in the form
(channel, payload, pid)
.If timeout is not None, None must be emitted at the specified timeout interval. If the timeout is zero, all the pending notifications must be yielded by the iterator and then StopIteration must be raised.
If the connection is closed for any reason, the iterator must silently stop by raising StopIteration. Further error control is then the responsibility of the user.
-
abstract
listen
(*channels) → None[source]¶ Start listening to the given channels.
Equivalent to issuing “LISTEN <x>” for x in channels.
-
abstract
listening_channels
() → [channel name, Ellipsis][source]¶ Return an iterator to all the channels currently being listened to.
-
abstract
notify
(*channels, **channel_and_payload) → int[source]¶ NOTIFY the channels with the given payload.
Equivalent to issuing “NOTIFY <channel>” or “NOTIFY <channel>, <payload>” for each item in channels and channel_and_payload. All NOTIFYs issued must occur in the same transaction.
The items in channels can either be a string or a tuple. If a string, no payload is given, but if an item is a builtins.tuple, the second item will be given as the payload. channels offers a means to issue NOTIFYs in guaranteed order.
The items in channel_and_payload are all payloaded NOTIFYs where the keys are the channels and the values are the payloads. Order is undefined.
-
abstract
prepare
(sql: str) → postgresql.api.Statement[source]¶ Create a new Statement instance bound to the connection using the given SQL.
>>> s = db.prepare("SELECT 1") >>> c = s() >>> c.next() (1,)
-
abstract
proc
(procedure_id: The procedure identifier; a valid ``regprocedure`` or Oid.) → postgresql.api.StoredProcedure[source]¶ Create a StoredProcedure instance using the given identifier.
The proc_id given can be either an
Oid
, or aregprocedure
that identifies the stored procedure to create the interface for.>>> p = db.proc('version()') >>> p() 'PostgreSQL 8.3.0' >>> qstr = "select oid from pg_proc where proname = 'generate_series'" >>> db.prepare(qstr).first() 1069 >>> generate_series = db.proc(1069) >>> list(generate_series(1,5)) [1, 2, 3, 4, 5]
-
abstract
reset
() → None[source]¶ Reset the connection into it’s original state.
Issues a
RESET ALL
to the database. If the database supports removing temporary tables created in the session, then remove them. Reapply initial configuration settings such as path.The purpose behind this method is to provide a soft-reconnect method that re-initializes the connection into its original state. One obvious use of this would be in a connection pool where the connection is being recycled.
-
abstract property
settings
¶ A Settings instance bound to the Database.
-
abstract
statement_from_id
(statement_id: The statement's identification string.) → postgresql.api.Statement[source]¶ Create a Statement object that was already prepared on the server. The distinction between this and a regular query is that it must be explicitly closed if it is no longer desired, and it is instantiated using the statement identifier as opposed to the SQL statement itself.
-
abstract
unlisten
(*channels) → None[source]¶ Stop listening to the given channels.
Equivalent to issuing “UNLISTEN <x>” for x in channels.
-
abstract property
version_info
¶ A version tuple of the database software similar Python’s sys.version_info.
>>> db.version_info (8, 1, 3, '', 0)
-
abstract property
xact
¶ Create a Transaction object using the given keyword arguments as its configuration.
-
abstract property
-
class
postgresql.api.
Driver
[source]¶ Bases:
postgresql.python.element.Element
The Driver element provides the Connector and other information pertaining to the implementation of the driver. Information about what the driver supports is available in instances.
-
class
postgresql.api.
Installation
[source]¶ Bases:
postgresql.python.element.Element
Interface to a PostgreSQL installation. Instances would provide various information about an installation of PostgreSQL accessible by the Python
-
abstract property
ssl
¶ Whether the installation supports SSL.
-
abstract property
type
¶ The “type” of PostgreSQL. Normally, the first component of the string returned by pg_config.
-
abstract property
version
¶ A version string consistent with what SELECT version() would output.
-
abstract property
version_info
¶ A tuple specifying the version in a form similar to Python’s sys.version_info. (8, 3, 3, ‘final’, 0)
See postgresql.versionstring.
-
abstract property
-
class
postgresql.api.
Message
[source]¶ Bases:
postgresql.python.element.Element
A message emitted by PostgreSQL. A message being a NOTICE, WARNING, INFO, etc.
-
abstract property
code
¶ The SQL state code of the message.
-
abstract property
details
¶ The additional details given with the message. Common keys should be the following:
‘severity’
‘context’
‘detail’
‘hint’
‘file’
‘line’
‘function’
‘position’
‘internal_position’
‘internal_query’
-
abstract
isconsistent
(other) → bool[source]¶ Whether the fields of the other Message object is consistent with the fields of self.
This must return the result of the comparison of code, source, message, and details.
This method is provided as the alternative to overriding equality; often, pointer equality is the desirable means for comparison, but equality of the fields is also necessary.
-
abstract property
message
¶ The primary message string.
-
abstract property
source
¶ Where the message originated from. Normally, ‘SERVER’, but sometimes ‘CLIENT’.
-
abstract property
-
class
postgresql.api.
Settings
[source]¶ Bases:
postgresql.python.element.Element
,collections.abc.MutableMapping
A mapping interface to the session’s settings. This provides a direct interface to
SHOW
orSET
commands. Identifiers and values need not be quoted specially as the implementation must do that work for the user.-
abstract
get
(key, default=None)[source]¶ Get the setting with the corresponding key. If the setting does not exist, return the default.
-
abstract
getset
(keys)[source]¶ Return a dictionary containing the key-value pairs of the requested settings. If any of the keys do not exist, a KeyError must be raised with the set of keys that did not exist.
-
abstract
-
class
postgresql.api.
Statement
[source]¶ Bases:
postgresql.python.element.Element
,collections.abc.Callable
,collections.abc.Iterable
Instances of Statement are returned by the prepare method of Database instances.
A Statement is an Iterable as well as Callable.
The Iterable interface is supported for queries that take no arguments at all. It allows the syntax:
>>> for x in db.prepare('select * FROM table'): ... pass
-
abstract
clone
() → postgresql.api.Statement[source]¶ Create a new statement object using the same factors as self.
When used for refreshing plans, the new clone should replace references to the original.
-
abstract
close
() → None[source]¶ Close the prepared statement releasing resources associated with it.
-
abstract property
column_names
¶ The attribute names of the columns produced by the statement.
A sequence of str objects stating the column name:
['column1', 'column2', 'emp_name']
-
abstract property
column_types
¶ The Python types of the columns produced by the statement.
A sequence of type objects:
[<class 'int'>, <class 'str'>]
-
abstract property
parameter_types
¶ The Python types expected of parameters given to the statement.
A sequence of type objects:
[<class 'int'>, <class 'str'>]
-
abstract property
pg_column_types
¶ The type Oids of the columns produced by the statement.
A sequence of int objects stating the SQL type name:
[27, 28]
-
abstract property
pg_parameter_types
¶ The type Oids of the parameters required by the statement.
A sequence of int objects stating the PostgreSQL type Oid:
[27, 28]
-
abstract property
sql_column_types
¶ The type of the columns produced by the statement.
A sequence of str objects stating the SQL type name:
['INTEGER', 'VARCHAR', 'INTERVAL']
-
abstract property
sql_parameter_types
¶ The type of the parameters required by the statement.
A sequence of str objects stating the SQL type name:
['INTEGER', 'VARCHAR', 'INTERVAL']
-
abstract property
statement_id
¶ The statment’s identifier.
-
abstract property
string
¶ The SQL string of the prepared statement.
None if not available. This can happen in cases where a statement is prepared on the server and a reference to the statement is sent to the client which subsequently uses the statement via the Database’s statement constructor.
-
abstract
-
class
postgresql.api.
StoredProcedure
[source]¶ Bases:
postgresql.python.element.Element
,collections.abc.Callable
A function stored on the database.
-
class
postgresql.api.
Transaction
[source]¶ Bases:
postgresql.python.element.Element
A Tranaction is an element that represents a transaction in the session. Once created, it’s ready to be started, and subsequently committed or rolled back.
Read-only transaction:
>>> with db.xact(mode = 'read only'): ... ...
Read committed isolation:
>>> with db.xact(isolation = 'READ COMMITTED'): ... ...
Savepoints are created if inside a transaction block:
>>> with db.xact(): ... with db.xact(): ... ...
-
abstract
abort
() → None¶ Abort the transaction.
If the transaction is a savepoint, ROLLBACK TO the savepoint identifier.
If the transaction is a transaction block, issue an ABORT.
If the transaction has already been aborted, do nothing.
-
abstract
begin
() → None¶ Start the transaction.
If the database is in a transaction block, the transaction should be configured as a savepoint. If any transaction block configuration was applied to the transaction, raise a postgresql.exceptions.OperationError.
If the database is not in a transaction block, start one using the configuration where:
self.isolation specifies the
ISOLATION LEVEL
. Normally,READ COMMITTED
,SERIALIZABLE
, orREAD UNCOMMITTED
.self.mode specifies the mode of the transaction. Normally,
READ ONLY
orREAD WRITE
.If the transaction is already open, do nothing.
If the transaction has been committed or aborted, raise an postgresql.exceptions.OperationError.
-
abstract
commit
() → None[source]¶ Commit the transaction.
If the transaction is a block, issue a COMMIT statement.
If the transaction was started inside a transaction block, it should be identified as a savepoint, and the savepoint should be released.
If the transaction has already been committed, do nothing.
-
abstract property
isolation
¶ The isolation level of the transaction block:
START TRANSACTION <isolation> [MODE];
The isolation property is a string and will be directly interpolated into the START TRANSACTION statement.
-
abstract property
mode
¶ The mode of the transaction block:
START TRANSACTION [ISOLATION] <mode>;
The mode property is a string and will be directly interpolated into the START TRANSACTION statement.
-
abstract
rollback
() → None[source]¶ Abort the transaction.
If the transaction is a savepoint, ROLLBACK TO the savepoint identifier.
If the transaction is a transaction block, issue an ABORT.
If the transaction has already been aborted, do nothing.
-
abstract
start
() → None[source]¶ Start the transaction.
If the database is in a transaction block, the transaction should be configured as a savepoint. If any transaction block configuration was applied to the transaction, raise a postgresql.exceptions.OperationError.
If the database is not in a transaction block, start one using the configuration where:
self.isolation specifies the
ISOLATION LEVEL
. Normally,READ COMMITTED
,SERIALIZABLE
, orREAD UNCOMMITTED
.self.mode specifies the mode of the transaction. Normally,
READ ONLY
orREAD WRITE
.If the transaction is already open, do nothing.
If the transaction has been committed or aborted, raise an postgresql.exceptions.OperationError.
-
abstract
postgresql.sys
¶
py-postgresql system functions and data.
Data¶
libpath
The local file system paths that contain query libraries.
Overridable Functions¶
- excformat
Information that makes up an exception’s displayed “body”. Effectively, the implementation of postgresql.exception.Error.__str__
- msghook
Display a message.
-
postgresql.sys.
default_msghook
(msg, format_message=<function format_element>)[source]¶ Built-in message hook. DON’T TOUCH!
-
postgresql.sys.
errformat
(*args, **kw)[source]¶ Raised Database Error formatter pointing to default_excformat.
Override if you like. All postgresql.exceptions.Error’s are formatted using this function.
-
postgresql.sys.
msghook
(*args, **kw)[source]¶ Message hook pointing to default_msghook.
Override if you like. All untrapped messages raised by driver connections come here to be printed to stderr.
postgresql.string
¶
String split and join operations for dealing with literals and identifiers.
Notably, the functions in this module are intended to be used for simple use-cases. It attempts to stay away from “real” parsing and simply provides functions for common needs, like the ability to identify unquoted portions of a query string so that logic or transformations can be applied to only unquoted portions. Scanning for statement terminators, or safely interpolating identifiers.
All functions deal with strict quoting rules.
-
postgresql.string.
quote_ident
(text)[source]¶ Replace every instance of ‘ with and place ‘ on each end
-
postgresql.string.
quote_ident_if_needed
(text)[source]¶ If needed, replace every instance of ‘”’ with ‘””’ and place ‘”’ on each end. Otherwise, just return the text.
-
postgresql.string.
quote_literal
(text)[source]¶ Escape the literal and wrap it in [single] quotations
-
postgresql.string.
split
(text)[source]¶ split the string up by into non-quoted and quoted portions. Zero and even numbered indexes are unquoted portions, while odd indexes are quoted portions.
Unquoted portions are regular strings, whereas quoted portions are pair-tuples specifying the quotation mechanism and the content thereof.
>>> list(split("select $$foobar$$")) ['select ', ('$$', 'foobar'), '']
If the split ends on a quoted section, it means the string’s quote was not terminated. Subsequently, there will be an even number of objects in the list.
Quotation errors are detected, but never raised. Rather it’s up to the user to identify the best course of action for the given split.
-
postgresql.string.
split_ident
(text, sep=',', quote='"', maxsplit=- 1)[source]¶ Split a series of identifiers using the specified separator.
-
postgresql.string.
split_qname
(text, maxsplit=- 1)[source]¶ Call to .split_ident() with a ‘.’ sep parameter.
-
postgresql.string.
split_sql
(sql, sep=';')[source]¶ Given SQL, safely split using the given separator. Notably, this yields fully split text. This should be used instead of split_sql_str() when quoted sections need be still be isolated.
>>> list(split_sql('select $$1$$ AS "foo;"; select 2;')) [['select ', ('$$', '1'), ' AS ', ('"', 'foo;'), ''], (' select 2',), ['']]
-
postgresql.string.
split_sql_str
(sql, sep=';')[source]¶ Identical to split_sql but yields unsplit text.
>>> list(split_sql_str('select $$1$$ AS "foo;"; select 2;')) ['select $$1$$ AS "foo;"', ' select 2', '']
postgresql.exceptions
¶
PostgreSQL exceptions and warnings with associated state codes.
The primary entry points of this module is the ErrorLookup function and the WarningLookup function. Given an SQL state code, they give back the most appropriate Error or Warning subclass.
- For more information on error codes see:
http://www.postgresql.org/docs/current/static/errcodes-appendix.html
This module is executable via -m: python -m postgresql.exceptions. It provides a convenient way to look up the exception object mapped to by the given error code:
$ python -m postgresql.exceptions XX000
postgresql.exceptions.InternalError [XX000]
If the exact error code is not found, it will try to find the error class’s exception(The first two characters of the error code make up the class identity):
$ python -m postgresql.exceptions XX400
postgresql.exceptions.InternalError [XX000]
If that fails, it will return postgresql.exceptions.Error
-
exception
postgresql.exceptions.
ActiveTransactionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AdminShutdownError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.OIError
,postgresql.exceptions.Disconnection
-
exception
postgresql.exceptions.
AmbiguityError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AmbiguousAliasError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AmbiguousColumnError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AmbiguousFunctionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AmbiguousParameterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ArrayElementError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AssignmentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
AuthenticationMethodError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverError
,postgresql.exceptions.Disconnection
Server requested an authentication method that is not supported by the driver.
-
exception
postgresql.exceptions.
AuthenticationSpecificationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
,postgresql.exceptions.Disconnection
-
exception
postgresql.exceptions.
BadAccessModeForBranchError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
BadCopyError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
BadIsolationForBranchError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
BinaryRepresentationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
BranchAlreadyActiveError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CFError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Configuration File Error
-
exception
postgresql.exceptions.
CardinalityError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Wrong number of rows returned
-
exception
postgresql.exceptions.
CaseNotFoundError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
CastCharacterValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CatalogNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CheckError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ClientCannotConnectError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ConnectionError
Client was unable to establish a connection to the server.
-
exception
postgresql.exceptions.
CoercionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ColumnDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ColumnError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ColumnReferenceError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CompositeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ConnectTimeoutError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverError
,postgresql.exceptions.Disconnection
Client was unable to esablish a connection in the given time
-
exception
postgresql.exceptions.
ConnectionDoesNotExistError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ConnectionError
The connection is closed or was never connected.
-
exception
postgresql.exceptions.
ConnectionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
,postgresql.exceptions.Disconnection
-
exception
postgresql.exceptions.
ConnectionFailureError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ConnectionError
Raised when a connection is dropped
-
exception
postgresql.exceptions.
ConnectionRejectionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ContainingSQLNotPermittedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CrashShutdownError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.OIError
,postgresql.exceptions.Disconnection
-
exception
postgresql.exceptions.
CursorDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CursorNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
CursorStateError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
DPDSEError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Dependent Privilege Descriptors Still Exist
-
exception
postgresql.exceptions.
DPDSEObjectError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DataCorruptedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DataError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
DataModificationProhibitedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DatabaseDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DateTimeFieldOverflowError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DateTimeFormatError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DeadlockError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
DeprecationWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
Disconnection
[source]¶ Bases:
postgresql.exceptions.Exception
Exception identifying errors that result in disconnection
-
exception
postgresql.exceptions.
DiskFullError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DriverError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Errors originating in the driver’s implementation.
-
class
postgresql.exceptions.
DriverWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateAliasError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateColumnError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateCursorError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateDatabaseError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateFileError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateFunctionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateObjectError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicatePreparedStatementError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateSchemaError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
DuplicateTableError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
DynamicResultSetsReturnedWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
EREError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
External Routine Exception
-
exception
postgresql.exceptions.
ERIEError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
External Routine Invocation Exception
-
exception
postgresql.exceptions.
EncodingError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
Error
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.message.Message
,postgresql.exceptions.Exception
A PostgreSQL Error
-
exception
postgresql.exceptions.
EscapeCharacterConflictError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
EscapeCharacterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DataError
Invalid escape character
-
exception
postgresql.exceptions.
EscapeOctetError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
EscapeSequenceError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
FeatureError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Unsupported feature
-
exception
postgresql.exceptions.
FloatingPointError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ForeignKeyCreationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ForeignKeyError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
FunctionDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
FunctionExecutedNoReturnStatementError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
GrantorError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
GrantorOperationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
GroupingError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ICVError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Integrity Contraint Violation
-
exception
postgresql.exceptions.
IRError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Insufficient Resource Error
-
exception
postgresql.exceptions.
ITSError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.TransactionError
Invalid Transaction State
-
class
postgresql.exceptions.
IgnoredClientParameterWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverWarning
Warn the user of a valid, but ignored parameter.
-
exception
postgresql.exceptions.
ImmutableRuntimeParameterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
ImplicitZeroBitPaddingWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
InFailedTransactionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ITSError
Occurs when an action occurs in a failed transaction.
-
exception
postgresql.exceptions.
InconsistentCursorIsolationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ITSError
The held cursor requires the same isolation.
-
exception
postgresql.exceptions.
IndeterminateTypeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
IndexCorruptedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
IndicatorOverflowError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
IndicatorParameterValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
InsecurityError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverError
,postgresql.exceptions.Disconnection
Error signifying a secure channel to a server cannot be established.
-
exception
postgresql.exceptions.
InsufficientPrivilegeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
IntegrityConstraintViolationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
InternalError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
IntervalFieldOverflowError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
InvalidSQLState
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
InvalidSavepointSpecificationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
LimitValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
LoadError
[source]¶ Bases:
postgresql.exceptions.Exception
Failed to load a library
-
exception
postgresql.exceptions.
LocatorError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
LocatorSpecificationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
LockFileExistsError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
LogArgumentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
MemoryError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ModifyingSQLDataNotPermittedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
NameTooLongError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NoActiveTransactionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NoActiveTransactionForBranchError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
NoDataWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
NoMoreSetsReturned
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NonstandardUseOfEscapeCharacterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NotNullError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NotXMLError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
NullValueEliminatedInSetFunctionWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NullValueNoIndicatorParameter
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NullValueNotAllowed
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NullValueNotAllowedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
NumericRangeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
OIError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Operator Intervention
-
exception
postgresql.exceptions.
ONIPSError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Object Not In Prerequisite State
-
exception
postgresql.exceptions.
ObjectDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ObjectInUseError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
OffsetValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
OperationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverError
An invalid operation on an interface element.
-
exception
postgresql.exceptions.
PLPGSQLError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Error raised by a PL/PgSQL procedural function
-
exception
postgresql.exceptions.
PLPGSQLNoDataFoundError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
PLPGSQLRaiseError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.PLPGSQLError
Error raised by a PL/PgSQL RAISE statement.
-
exception
postgresql.exceptions.
PLPGSQLTooManyRowsError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ParameterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ParameterValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
PowerFunctionArgumentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
PreparedStatementDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
PrivilegeNotGrantedWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
PrivilegeNotRevokedWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ProhibitedSQLStatementError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ProtocolError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
QueryCanceledError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ReadOnlyTransactionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ITSError
Occurs when an alteration occurs in a read-only transaction.
-
exception
postgresql.exceptions.
ReadingDataProhibitedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ReadingSQLDataNotPermittedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
RecursionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
RegularExpressionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ReservedNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
RestrictError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
RoleSpecificationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
SEARVError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
Syntax Error or Access Rule Violation
-
exception
postgresql.exceptions.
SEARVNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SIOError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
System I/O
-
exception
postgresql.exceptions.
SQLNotYetCompleteError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
SREError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
SQL Routine Exception
-
exception
postgresql.exceptions.
SRFProtocolError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SavepointError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.TransactionError
Classification error designating errors that relate to savepoints.
-
exception
postgresql.exceptions.
SchemaAndDataStatementsError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.ITSError
Mixed schema and data statements not allowed.
-
exception
postgresql.exceptions.
SchemaDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SchemaNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SerializationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ServerNotReadyError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.OIError
,postgresql.exceptions.Disconnection
Thrown when a connection is established to a server that is still starting up.
-
exception
postgresql.exceptions.
SpecificTypeMismatch
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
StatementCompletionUnknownError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
StatementNameError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
StatementProhibitedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
StringDataLengthError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
StringDataRightTruncationWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
StringRightTruncationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SubstringError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
SyntaxError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TRError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.TransactionError
Transaction Rollback
-
exception
postgresql.exceptions.
TableDefinitionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TextRepresentationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TimeZoneDisplacementValueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TooManyConnectionsError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TransactionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
TransactionInitiationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TransactionResolutionUnknownError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TransactionTerminationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TriggerProtocolError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TriggeredActionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
TriggeredDataChangeViolation
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
TrimError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
TypeConversionWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverWarning
Report a potential issue with a conversion.
-
exception
postgresql.exceptions.
TypeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
TypeIOError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.DriverError
Driver failed to pack or unpack a tuple.
-
exception
postgresql.exceptions.
TypeMismatchError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedColumnError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedFileError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedFunctionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedObjectError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedParameterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UndefinedTableError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UniqueError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UnterminatedCStringError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
UntranslatableCharacterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
class
postgresql.exceptions.
Warning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.message.Message
-
exception
postgresql.exceptions.
WidthBucketFunctionArgumentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
WindowError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
WithCheckOptionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
-
exception
postgresql.exceptions.
WrongObjectTypeError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
XMLCommentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
XMLContentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
XMLDocumentError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
XMLProcessingInstructionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ZeroDivisionError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
exception
postgresql.exceptions.
ZeroLengthString
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶
-
postgresql.exceptions.
map_errors_and_warnings
(objs: A iterable of `Warning`s and `Error`'s, error_container: apply the code to error association to this object = {'': <class 'postgresql.exceptions.Error'>, '--000': <class 'postgresql.exceptions.DriverError'>, '--AUT': <class 'postgresql.exceptions.AuthenticationMethodError'>, '--CIO': <class 'postgresql.exceptions.ColumnError'>, '--OPE': <class 'postgresql.exceptions.OperationError'>, '--PIO': <class 'postgresql.exceptions.ParameterError'>, '--SEC': <class 'postgresql.exceptions.InsecurityError'>, '--TIO': <class 'postgresql.exceptions.TypeIOError'>, '--TOE': <class 'postgresql.exceptions.ConnectTimeoutError'>, '--cIO': <class 'postgresql.exceptions.CompositeError'>, '03000': <class 'postgresql.exceptions.SQLNotYetCompleteError'>, '08000': <class 'postgresql.exceptions.ConnectionError'>, '08001': <class 'postgresql.exceptions.ClientCannotConnectError'>, '08003': <class 'postgresql.exceptions.ConnectionDoesNotExistError'>, '08004': <class 'postgresql.exceptions.ConnectionRejectionError'>, '08006': <class 'postgresql.exceptions.ConnectionFailureError'>, '08007': <class 'postgresql.exceptions.TransactionResolutionUnknownError'>, '08P01': <class 'postgresql.exceptions.ProtocolError'>, '09000': <class 'postgresql.exceptions.TriggeredActionError'>, '0A000': <class 'postgresql.exceptions.FeatureError'>, '0B000': <class 'postgresql.exceptions.TransactionInitiationError'>, '0F000': <class 'postgresql.exceptions.LocatorError'>, '0F001': <class 'postgresql.exceptions.LocatorSpecificationError'>, '0L000': <class 'postgresql.exceptions.GrantorError'>, '0LP01': <class 'postgresql.exceptions.GrantorOperationError'>, '0P000': <class 'postgresql.exceptions.RoleSpecificationError'>, '20000': <class 'postgresql.exceptions.CaseNotFoundError'>, '21000': <class 'postgresql.exceptions.CardinalityError'>, '22000': <class 'postgresql.exceptions.DataError'>, '22001': <class 'postgresql.exceptions.StringRightTruncationError'>, '22002': <class 'postgresql.exceptions.NullValueNoIndicatorParameter'>, '22003': <class 'postgresql.exceptions.NumericRangeError'>, '22004': <class 'postgresql.exceptions.NullValueNotAllowedError'>, '22005': <class 'postgresql.exceptions.AssignmentError'>, '22007': <class 'postgresql.exceptions.DateTimeFormatError'>, '22008': <class 'postgresql.exceptions.DateTimeFieldOverflowError'>, '22009': <class 'postgresql.exceptions.TimeZoneDisplacementValueError'>, '2200B': <class 'postgresql.exceptions.EscapeCharacterConflictError'>, '2200C': <class 'postgresql.exceptions.EscapeCharacterError'>, '2200D': <class 'postgresql.exceptions.EscapeOctetError'>, '2200F': <class 'postgresql.exceptions.ZeroLengthString'>, '2200G': <class 'postgresql.exceptions.SpecificTypeMismatch'>, '2200L': <class 'postgresql.exceptions.NotXMLError'>, '2200M': <class 'postgresql.exceptions.XMLDocumentError'>, '2200N': <class 'postgresql.exceptions.XMLContentError'>, '2200S': <class 'postgresql.exceptions.XMLCommentError'>, '2200T': <class 'postgresql.exceptions.XMLProcessingInstructionError'>, '22010': <class 'postgresql.exceptions.IndicatorParameterValueError'>, '22011': <class 'postgresql.exceptions.SubstringError'>, '22012': <class 'postgresql.exceptions.ZeroDivisionError'>, '22015': <class 'postgresql.exceptions.IntervalFieldOverflowError'>, '22018': <class 'postgresql.exceptions.CastCharacterValueError'>, '2201B': <class 'postgresql.exceptions.RegularExpressionError'>, '2201E': <class 'postgresql.exceptions.LogArgumentError'>, '2201F': <class 'postgresql.exceptions.PowerFunctionArgumentError'>, '2201G': <class 'postgresql.exceptions.WidthBucketFunctionArgumentError'>, '2201W': <class 'postgresql.exceptions.LimitValueError'>, '2201X': <class 'postgresql.exceptions.OffsetValueError'>, '22020': <class 'postgresql.exceptions.LimitValueError'>, '22021': <class 'postgresql.exceptions.EncodingError'>, '22022': <class 'postgresql.exceptions.IndicatorOverflowError'>, '22023': <class 'postgresql.exceptions.ParameterValueError'>, '22024': <class 'postgresql.exceptions.UnterminatedCStringError'>, '22025': <class 'postgresql.exceptions.EscapeSequenceError'>, '22026': <class 'postgresql.exceptions.StringDataLengthError'>, '22027': <class 'postgresql.exceptions.TrimError'>, '2202E': <class 'postgresql.exceptions.ArrayElementError'>, '22P01': <class 'postgresql.exceptions.FloatingPointError'>, '22P02': <class 'postgresql.exceptions.TextRepresentationError'>, '22P03': <class 'postgresql.exceptions.BinaryRepresentationError'>, '22P04': <class 'postgresql.exceptions.BadCopyError'>, '22P05': <class 'postgresql.exceptions.UntranslatableCharacterError'>, '22P06': <class 'postgresql.exceptions.NonstandardUseOfEscapeCharacterError'>, '23000': <class 'postgresql.exceptions.ICVError'>, '23001': <class 'postgresql.exceptions.RestrictError'>, '23502': <class 'postgresql.exceptions.NotNullError'>, '23503': <class 'postgresql.exceptions.ForeignKeyError'>, '23505': <class 'postgresql.exceptions.UniqueError'>, '23514': <class 'postgresql.exceptions.CheckError'>, '24000': <class 'postgresql.exceptions.CursorStateError'>, '25000': <class 'postgresql.exceptions.ITSError'>, '25001': <class 'postgresql.exceptions.ActiveTransactionError'>, '25002': <class 'postgresql.exceptions.BranchAlreadyActiveError'>, '25003': <class 'postgresql.exceptions.BadAccessModeForBranchError'>, '25004': <class 'postgresql.exceptions.BadIsolationForBranchError'>, '25005': <class 'postgresql.exceptions.NoActiveTransactionForBranchError'>, '25006': <class 'postgresql.exceptions.ReadOnlyTransactionError'>, '25007': <class 'postgresql.exceptions.SchemaAndDataStatementsError'>, '25008': <class 'postgresql.exceptions.InconsistentCursorIsolationError'>, '25P01': <class 'postgresql.exceptions.NoActiveTransactionError'>, '25P02': <class 'postgresql.exceptions.InFailedTransactionError'>, '26000': <class 'postgresql.exceptions.StatementNameError'>, '27000': <class 'postgresql.exceptions.TriggeredDataChangeViolation'>, '28000': <class 'postgresql.exceptions.AuthenticationSpecificationError'>, '2B000': <class 'postgresql.exceptions.DPDSEError'>, '2BP01': <class 'postgresql.exceptions.DPDSEObjectError'>, '2D000': <class 'postgresql.exceptions.TransactionTerminationError'>, '2F000': <class 'postgresql.exceptions.SREError'>, '2F002': <class 'postgresql.exceptions.DataModificationProhibitedError'>, '2F003': <class 'postgresql.exceptions.StatementProhibitedError'>, '2F004': <class 'postgresql.exceptions.ReadingDataProhibitedError'>, '2F005': <class 'postgresql.exceptions.FunctionExecutedNoReturnStatementError'>, '34000': <class 'postgresql.exceptions.CursorNameError'>, '38000': <class 'postgresql.exceptions.EREError'>, '38001': <class 'postgresql.exceptions.ContainingSQLNotPermittedError'>, '38002': <class 'postgresql.exceptions.ModifyingSQLDataNotPermittedError'>, '38003': <class 'postgresql.exceptions.ProhibitedSQLStatementError'>, '38004': <class 'postgresql.exceptions.ReadingSQLDataNotPermittedError'>, '39000': <class 'postgresql.exceptions.ERIEError'>, '39001': <class 'postgresql.exceptions.InvalidSQLState'>, '39004': <class 'postgresql.exceptions.NullValueNotAllowed'>, '39P01': <class 'postgresql.exceptions.TriggerProtocolError'>, '39P02': <class 'postgresql.exceptions.SRFProtocolError'>, '3B000': <class 'postgresql.exceptions.SavepointError'>, '3B001': <class 'postgresql.exceptions.InvalidSavepointSpecificationError'>, '3D000': <class 'postgresql.exceptions.CatalogNameError'>, '3F000': <class 'postgresql.exceptions.SchemaNameError'>, '40000': <class 'postgresql.exceptions.TRError'>, '40001': <class 'postgresql.exceptions.SerializationError'>, '40002': <class 'postgresql.exceptions.IntegrityConstraintViolationError'>, '40003': <class 'postgresql.exceptions.StatementCompletionUnknownError'>, '40P01': <class 'postgresql.exceptions.DeadlockError'>, '42000': <class 'postgresql.exceptions.SEARVError'>, '42501': <class 'postgresql.exceptions.InsufficientPrivilegeError'>, '42601': <class 'postgresql.exceptions.SyntaxError'>, '42602': <class 'postgresql.exceptions.SEARVNameError'>, '42611': <class 'postgresql.exceptions.ColumnDefinitionError'>, '42622': <class 'postgresql.exceptions.NameTooLongError'>, '42701': <class 'postgresql.exceptions.DuplicateColumnError'>, '42702': <class 'postgresql.exceptions.AmbiguousColumnError'>, '42703': <class 'postgresql.exceptions.UndefinedColumnError'>, '42704': <class 'postgresql.exceptions.UndefinedObjectError'>, '42710': <class 'postgresql.exceptions.DuplicateObjectError'>, '42712': <class 'postgresql.exceptions.DuplicateAliasError'>, '42723': <class 'postgresql.exceptions.DuplicateFunctionError'>, '42725': <class 'postgresql.exceptions.AmbiguousFunctionError'>, '42803': <class 'postgresql.exceptions.GroupingError'>, '42804': <class 'postgresql.exceptions.TypeMismatchError'>, '42809': <class 'postgresql.exceptions.WrongObjectTypeError'>, '42830': <class 'postgresql.exceptions.ForeignKeyCreationError'>, '42846': <class 'postgresql.exceptions.CoercionError'>, '42883': <class 'postgresql.exceptions.UndefinedFunctionError'>, '42939': <class 'postgresql.exceptions.ReservedNameError'>, '42P01': <class 'postgresql.exceptions.UndefinedTableError'>, '42P02': <class 'postgresql.exceptions.UndefinedParameterError'>, '42P03': <class 'postgresql.exceptions.DuplicateCursorError'>, '42P04': <class 'postgresql.exceptions.DuplicateDatabaseError'>, '42P05': <class 'postgresql.exceptions.DuplicatePreparedStatementError'>, '42P06': <class 'postgresql.exceptions.DuplicateSchemaError'>, '42P07': <class 'postgresql.exceptions.DuplicateTableError'>, '42P08': <class 'postgresql.exceptions.AmbiguousParameterError'>, '42P09': <class 'postgresql.exceptions.AmbiguousAliasError'>, '42P10': <class 'postgresql.exceptions.ColumnReferenceError'>, '42P11': <class 'postgresql.exceptions.CursorDefinitionError'>, '42P12': <class 'postgresql.exceptions.DatabaseDefinitionError'>, '42P13': <class 'postgresql.exceptions.FunctionDefinitionError'>, '42P14': <class 'postgresql.exceptions.PreparedStatementDefinitionError'>, '42P15': <class 'postgresql.exceptions.SchemaDefinitionError'>, '42P16': <class 'postgresql.exceptions.TableDefinitionError'>, '42P17': <class 'postgresql.exceptions.ObjectDefinitionError'>, '42P18': <class 'postgresql.exceptions.IndeterminateTypeError'>, '42P19': <class 'postgresql.exceptions.RecursionError'>, '42P20': <class 'postgresql.exceptions.WindowError'>, '44000': <class 'postgresql.exceptions.WithCheckOptionError'>, '53000': <class 'postgresql.exceptions.IRError'>, '53100': <class 'postgresql.exceptions.DiskFullError'>, '53200': <class 'postgresql.exceptions.MemoryError'>, '53300': <class 'postgresql.exceptions.TooManyConnectionsError'>, '55000': <class 'postgresql.exceptions.ONIPSError'>, '55006': <class 'postgresql.exceptions.ObjectInUseError'>, '55P02': <class 'postgresql.exceptions.ImmutableRuntimeParameterError'>, '55P03': <class 'postgresql.exceptions.UnavailableLockError'>, '57000': <class 'postgresql.exceptions.OIError'>, '57014': <class 'postgresql.exceptions.QueryCanceledError'>, '57P01': <class 'postgresql.exceptions.AdminShutdownError'>, '57P02': <class 'postgresql.exceptions.CrashShutdownError'>, '57P03': <class 'postgresql.exceptions.ServerNotReadyError'>, '58000': <class 'postgresql.exceptions.SIOError'>, '58P01': <class 'postgresql.exceptions.UndefinedFileError'>, '58P02': <class 'postgresql.exceptions.DuplicateFileError'>, 'F0000': <class 'postgresql.exceptions.CFError'>, 'F0001': <class 'postgresql.exceptions.LockFileExistsError'>, 'P0000': <class 'postgresql.exceptions.PLPGSQLError'>, 'P0001': <class 'postgresql.exceptions.PLPGSQLRaiseError'>, 'P0002': <class 'postgresql.exceptions.PLPGSQLNoDataFoundError'>, 'P0003': <class 'postgresql.exceptions.PLPGSQLTooManyRowsError'>, 'XX000': <class 'postgresql.exceptions.InternalError'>, 'XX001': <class 'postgresql.exceptions.DataCorruptedError'>, 'XX002': <class 'postgresql.exceptions.IndexCorruptedError'>}, warning_container: apply the code to warning association to this object = {'01-00': <class 'postgresql.exceptions.DriverWarning'>, '01-CP': <class 'postgresql.exceptions.IgnoredClientParameterWarning'>, '01-TP': <class 'postgresql.exceptions.TypeConversionWarning'>, '01000': <class 'postgresql.exceptions.Warning'>, '01003': <class 'postgresql.exceptions.NullValueEliminatedInSetFunctionWarning'>, '01004': <class 'postgresql.exceptions.StringDataRightTruncationWarning'>, '01006': <class 'postgresql.exceptions.PrivilegeNotRevokedWarning'>, '01007': <class 'postgresql.exceptions.PrivilegeNotGrantedWarning'>, '01008': <class 'postgresql.exceptions.ImplicitZeroBitPaddingWarning'>, '0100C': <class 'postgresql.exceptions.DynamicResultSetsReturnedWarning'>, '01P01': <class 'postgresql.exceptions.DeprecationWarning'>, '02000': <class 'postgresql.exceptions.NoDataWarning'>, '02001': <class 'postgresql.exceptions.NoMoreSetsReturned'>})[source]¶ Construct the code-to-error and code-to-warning associations.
postgresql.temporal
¶
Temporary PostgreSQL cluster for the process.
-
class
postgresql.temporal.
Temporal
[source]¶ Bases:
object
Manages a temporary cluster for the duration of the process.
Instances of this class reference a distinct cluster. These clusters are transient; they will only exist until the process exits.
Usage:
>>> from postgresql.temporal import pg_tmp >>> with pg_tmp: ... ps = db.prepare('SELECT 1') ... assert ps.first() == 1
Or pg_tmp can decorate a method or function.
-
cluster_dirname
()¶ Format the cluster directory name.
-
-
postgresql.temporal.
pg_tmp
= <postgresql.temporal.Temporal object>¶ The process’ temporary cluster.
postgresql.installation
¶
Collect and access PostgreSQL installation information.
-
class
postgresql.installation.
Installation
(info: dict)[source]¶ Bases:
postgresql.api.Installation
Class providing a Python interface to PostgreSQL installation information.
-
info
= None¶ The pg_config information dictionary.
-
property
ssl
¶ Whether the installation was compiled with SSL support.
-
-
postgresql.installation.
default
(typ=<class 'postgresql.installation.Installation'>)[source]¶ Get the default Installation.
Uses default_pg_config() to identify the executable.
postgresql.cluster
¶
Create, control, and destroy PostgreSQL clusters.
postgresql.cluster provides a programmer’s interface to controlling a PostgreSQL cluster. It provides direct access to proper signalling interfaces.
-
class
postgresql.cluster.
Cluster
(installation: installation object, data_directory: path to the data directory)[source]¶ Bases:
postgresql.api.Cluster
Interface to a PostgreSQL cluster.
Provides mechanisms to start, stop, restart, kill, drop, and initalize a cluster(data directory).
Cluster does not strive to be consistent with
pg_ctl
. This is considered to be a base class for managing a cluster, and is intended to be extended to accommodate for a particular purpose.-
connect
(**kw)[source]¶ Create an established connection from the connector.
Cluster must be running.
-
connector
(**kw)[source]¶ Create a postgresql.driver connector based on the given keywords and listen_addresses and port configuration in settings.
-
property
daemon_path
¶ Path to the executable to use to startup the cluster.
-
property
hba_file
¶ The path to the HBA file of the cluster.
-
init
(password: Password to assign to the cluster's superuser(`user` keyword). = None, **kw)[source]¶ Create the cluster at the given data_directory using the provided keyword parameters as options to the command.
command_option_map provides the mapping of keyword arguments to command options.
-
property
pid
¶ If we have the subprocess, use the pid on the object.
-
ready_for_connections
()[source]¶ If the daemon is running, and is not in startup mode.
This only works for clusters configured for TCP/IP connections.
-
restart
(logfile=None, settings=None, timeout=10)[source]¶ Restart the cluster gracefully.
This provides a higher level interface to stopping then starting the cluster. It will perform the wait operations and block until the restart is complete.
If waiting is not desired, .start() and .stop() should be used directly.
-
running
()[source]¶ Whether or not the postmaster is running.
This does not mean the cluster is accepting connections.
-
property
settings
¶ A Settings interface to the
postgresql.conf
file associated with the cluster.
-
start
(logfile: Where to send stderr = None, settings: Mapping of runtime parameters = None)[source]¶ Start the cluster.
-
wait_until_started
(timeout: how long to wait before throwing a timeout exception = 10, delay: how long to sleep before re-testing = 0.05)[source]¶ After the start method is used, this can be ran in order to block until the cluster is ready for use.
This method loops until ready_for_connections returns True in order to make sure that the cluster is actually up.
-
wait_until_stopped
(timeout: how long to wait before throwing a timeout exception = 10, delay: how long to sleep before re-testing = 0.05)[source]¶ After the stop method is used, this can be ran in order to block until the cluster is shutdown.
Additionally, catching ClusterTimeoutError exceptions would be a starting point for making decisions about whether or not to issue a kill to the daemon.
-
-
exception
postgresql.cluster.
ClusterError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Error
General cluster error.
-
exception
postgresql.cluster.
ClusterInitializationError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.cluster.ClusterError
General cluster initialization failure
-
exception
postgresql.cluster.
ClusterNotRunningError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.cluster.ClusterError
Cluster is not running
-
exception
postgresql.cluster.
ClusterStartupError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.cluster.ClusterError
Cluster startup failed
-
exception
postgresql.cluster.
ClusterTimeoutError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.cluster.ClusterError
Cluster operation timed out
-
class
postgresql.cluster.
ClusterWarning
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.exceptions.Warning
Warning issued by cluster operations
-
exception
postgresql.cluster.
InitDBError
(message: The primary information of the message, code: Message code to attach (SQL state) = None, details: additional information associated with the message = {}, source: Which side generated the message(SERVER, CLIENT) = None, creator: The interface element that called for instantiation = None)[source]¶ Bases:
postgresql.cluster.ClusterInitializationError
A non-zero result was returned by the initdb command
postgresql.copyman
¶
Manage complex COPY operations; one-to-many COPY streaming.
Primarily this module houses the CopyManager class, and the transfer function for a high-level interface to using the CopyManager.
-
class
postgresql.copyman.
CallReceiver
(callable)[source]¶ Bases:
postgresql.copyman.Receiver
Call the given object with a list of COPY lines.
-
exception
postgresql.copyman.
CopyFail
(manager, reason=None, receiver_faults=None, producer_fault=None)[source]¶ Bases:
Exception
Exception thrown by the CopyManager when the COPY operation failed.
The ‘manager’ attribute the CopyManager that raised the CopyFail.
The ‘reason’ attribute is a string indicating why it failed.
The ‘receiver_faults’ attribute is a mapping of receivers to exceptions that were raised on exit.
The ‘producer_fault’ attribute specifies if the producer raise an exception on exit.
-
class
postgresql.copyman.
CopyManager
(producer, *receivers)[source]¶ Bases:
postgresql.python.element.Element
,collections.abc.Iterator
A class for managing COPY operations.
Connects the producer to the receivers.
-
class
postgresql.copyman.
Fitting
[source]¶ Bases:
postgresql.python.element.Element
-
abstract property
protocol
¶ The COPY data format produced or consumed.
-
abstract property
-
class
postgresql.copyman.
IteratorProducer
(iterator)[source]¶ Bases:
postgresql.copyman.Producer
-
class
postgresql.copyman.
NullProducer
[source]¶ Bases:
postgresql.copyman.Producer
Produces no copy data.
-
class
postgresql.copyman.
NullReceiver
[source]¶ Bases:
postgresql.copyman.Receiver
-
class
postgresql.copyman.
Producer
[source]¶ Bases:
postgresql.copyman.Fitting
,collections.abc.Iterator
-
exception
postgresql.copyman.
ProducerFault
(manager)[source]¶ Bases:
postgresql.copyman.Fault
Exception raised when the Producer caused an exception.
Normally, Producer faults are fatal.
-
class
postgresql.copyman.
ProtocolProducer
(recv_into: callable taking writable buffer and size, buffer_size=10240)[source]¶ Bases:
postgresql.copyman.Producer
Producer using a PQv3 data stream.
Normally, this class needs to be subclassed as it assumes that the given recv_into function will write COPY messages.
-
class
postgresql.copyman.
ProtocolReceiver
(send)[source]¶ Bases:
postgresql.copyman.Receiver
-
class
postgresql.copyman.
Receiver
[source]¶ Bases:
postgresql.copyman.Fitting
-
exception
postgresql.copyman.
ReceiverFault
(manager, faults)[source]¶ Bases:
postgresql.copyman.Fault
Exception raised when Receivers cause an exception.
Faults should be trapped if recovery from an exception is possible, or if the failed receiver is optional to the succes of the operation.
The ‘manager’ attribute is the CopyManager that raised the fault.
The ‘faults’ attribute is a dictionary mapping the receiver to the exception instance raised.
-
class
postgresql.copyman.
WireState
(condition=<method-wrapper '__ne__' of int object>)[source]¶ Bases:
object
Manages the state of the wire.
This class manages three possible positions:
Between wire messages
Inside message header
Inside message (with complete header)
The wire state will become unusable when the configured condition is True.
-
postgresql.copyman.
default_buffer_size
= 10240¶ 10KB buffer for COPY messages by default.
-
postgresql.copyman.
transfer
(producer, *receivers)[source]¶ Perform a COPY operation using the given statements:
>>> import copyman >>> copyman.transfer(src.prepare("COPY table TO STDOUT"), dst.prepare("COPY table FROM STDIN"))
-
postgresql.copyman.
ulong_pack
()¶ S.pack(v1, v2, …) -> bytes
Return a bytes object containing values v1, v2, … packed according to the format string S.format. See help(struct) for more on format strings.
postgresql.alock
¶
Tools for Advisory Locks
-
class
postgresql.alock.
ALock
(database, *identifiers)[source]¶ Bases:
postgresql.python.element.Element
Advisory Lock class for managing the acquisition and release of a sequence of PostgreSQL advisory locks.
ALock()’s are fairly consistent with threading.RLock()’s. They can be acquired multiple times, and they must be released the same number of times for the lock to actually be released.
A notably difference is that ALock’s manage a sequence of lock identifiers. This means that a given ALock() may represent multiple advisory locks.
-
acquire
(blocking=True, len=<built-in function len>)[source]¶ Acquire the locks using the configured identifiers.
-
locked
()[source]¶ Whether the locks have been acquired. This method is sensitive to the connection’s state. If the connection is closed, it will return False.
-
abstract property
mode
¶ The mode of the lock class.
-
-
class
postgresql.alock.
ExclusiveLock
(database, *identifiers)[source]¶ Bases:
postgresql.alock.ALock
Bases:
postgresql.alock.ALock