Markdown Format | JSON API | MCP Server Tool
Help on module pgdb: NAME pgdb - pgdb - DB-API 2.0 compliant module for PyGreSQL. DESCRIPTION (c) 1999, Pascal Andre <andre AT via.fr>. See package documentation for further information on copyright. Inline documentation is sparse. See DB-API 2.0 specification for usage information: http://www.python.org/peps/pep-0249.html Basic usage: pgdb.connect(connect_string) # open a connection # connect_string = 'host:database:user:password:opt' # All parts are optional. You may also pass host through # password as keyword arguments. To pass a port, # pass it in the host keyword parameter: connection = pgdb.connect(host='localhost:5432') cursor = connection.cursor() # open a cursor cursor.execute(query[, params]) # Execute a query, binding params (a dictionary) if they are # passed. The binding syntax is the same as the % operator # for dictionaries, and no quoting is done. cursor.executemany(query, list of params) # Execute a query many times, binding each param dictionary # from the list. cursor.fetchone() # fetch one row, [value, value, ...] cursor.fetchall() # fetch all rows, [[value, value, ...], ...] cursor.fetchmany([size]) # returns size or cursor.arraysize number of rows, # [[value, value, ...], ...] from result set. # Default cursor.arraysize is 1. cursor.description # returns information about the columns # [(column_name, type_name, display_size, # internal_size, precision, scale, null_ok), ...] # Note that display_size, precision, scale and null_ok # are not implemented. cursor.rowcount # number of rows available in the result set # Available after a call to execute. connection.commit() # commit transaction connection.rollback() # or rollback transaction cursor.close() # close the cursor connection.close() # close the connection CLASSES builtins.Exception(builtins.BaseException) pg.Error pg.DatabaseError pg.DataError pg.IntegrityError pg.NotSupportedError pg.OperationalError pg.ProgrammingError pg.InterfaceError pg.Warning builtins.bytes(builtins.object) Binary builtins.dict(builtins.object) Hstore builtins.frozenset(builtins.object) Type builtins.object Connection Cursor Json Literal uuid.UUID class Binary(builtins.bytes) | Construct an object capable of holding a binary (long) string value. | | Method resolution order: | Binary | builtins.bytes | builtins.object | | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.bytes: | | __add__(self, value, /) | Return self+value. | | __contains__(self, key, /) | Return key in self. | | __eq__(self, value, /) | Return self==value. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __getitem__(self, key, /) | Return self[key]. | | __getnewargs__(...) | | __gt__(self, value, /) | Return self>value. | | __hash__(self, /) | Return hash(self). | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __len__(self, /) | Return len(self). | | __lt__(self, value, /) | Return self<value. | | __mod__(self, value, /) | Return self%value. | | __mul__(self, value, /) | Return self*value. | | __ne__(self, value, /) | Return self!=value. | | __repr__(self, /) | Return repr(self). | | __rmod__(self, value, /) | Return value%self. | | __rmul__(self, value, /) | Return value*self. | | __str__(self, /) | Return str(self). | | capitalize(...) | B.capitalize() -> copy of B | | Return a copy of B with only its first character capitalized (ASCII) | and the rest lower-cased. | | center(self, width, fillchar=b' ', /) | Return a centered string of length width. | | Padding is done using the specified fill character. | | count(...) | B.count(sub[, start[, end]]) -> int | | Return the number of non-overlapping occurrences of subsection sub in | bytes B[start:end]. Optional arguments start and end are interpreted | as in slice notation. | | decode(self, /, encoding='utf-8', errors='strict') | Decode the bytes using the codec registered for encoding. | | encoding | The encoding with which to decode the bytes. | errors | The error handling scheme to use for the handling of decoding errors. | The default is 'strict' meaning that decoding errors raise a | UnicodeDecodeError. Other possible values are 'ignore' and 'replace' | as well as any other name registered with codecs.register_error that | can handle UnicodeDecodeErrors. | | endswith(...) | B.endswith(suffix[, start[, end]]) -> bool | | Return True if B ends with the specified suffix, False otherwise. | With optional start, test B beginning at that position. | With optional end, stop comparing B at that position. | suffix can also be a tuple of bytes to try. | | expandtabs(self, /, tabsize=8) | Return a copy where all tab characters are expanded using spaces. | | If tabsize is not given, a tab size of 8 characters is assumed. | | find(...) | B.find(sub[, start[, end]]) -> int | | Return the lowest index in B where subsection sub is found, | such that sub is contained within B[start,end]. Optional | arguments start and end are interpreted as in slice notation. | | Return -1 on failure. | | hex(...) | Create a string of hexadecimal numbers from a bytes object. | | sep | An optional single character or byte to separate hex bytes. | bytes_per_sep | How many bytes between separators. Positive values count from the | right, negative values count from the left. | | Example: | >>> value = b'\xb9\x01\xef' | >>> value.hex() | 'b901ef' | >>> value.hex(':') | 'b9:01:ef' | >>> value.hex(':', 2) | 'b9:01ef' | >>> value.hex(':', -2) | 'b901:ef' | | index(...) | B.index(sub[, start[, end]]) -> int | | Return the lowest index in B where subsection sub is found, | such that sub is contained within B[start,end]. Optional | arguments start and end are interpreted as in slice notation. | | Raises ValueError when the subsection is not found. | | isalnum(...) | B.isalnum() -> bool | | Return True if all characters in B are alphanumeric | and there is at least one character in B, False otherwise. | | isalpha(...) | B.isalpha() -> bool | | Return True if all characters in B are alphabetic | and there is at least one character in B, False otherwise. | | isascii(...) | B.isascii() -> bool | | Return True if B is empty or all characters in B are ASCII, | False otherwise. | | isdigit(...) | B.isdigit() -> bool | | Return True if all characters in B are digits | and there is at least one character in B, False otherwise. | | islower(...) | B.islower() -> bool | | Return True if all cased characters in B are lowercase and there is | at least one cased character in B, False otherwise. | | isspace(...) | B.isspace() -> bool | | Return True if all characters in B are whitespace | and there is at least one character in B, False otherwise. | | istitle(...) | B.istitle() -> bool | | Return True if B is a titlecased string and there is at least one | character in B, i.e. uppercase characters may only follow uncased | characters and lowercase characters only cased ones. Return False | otherwise. | | isupper(...) | B.isupper() -> bool | | Return True if all cased characters in B are uppercase and there is | at least one cased character in B, False otherwise. | | join(self, iterable_of_bytes, /) | Concatenate any number of bytes objects. | | The bytes whose method is called is inserted in between each pair. | | The result is returned as a new bytes object. | | Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'. | | ljust(self, width, fillchar=b' ', /) | Return a left-justified string of length width. | | Padding is done using the specified fill character. | | lower(...) | B.lower() -> copy of B | | Return a copy of B with all ASCII characters converted to lowercase. | | lstrip(self, bytes=None, /) | Strip leading bytes contained in the argument. | | If the argument is omitted or None, strip leading ASCII whitespace. | | partition(self, sep, /) | Partition the bytes into three parts using the given separator. | | This will search for the separator sep in the bytes. If the separator is found, | returns a 3-tuple containing the part before the separator, the separator | itself, and the part after it. | | If the separator is not found, returns a 3-tuple containing the original bytes | object and two empty bytes objects. | | removeprefix(self, prefix, /) | Return a bytes object with the given prefix string removed if present. | | If the bytes starts with the prefix string, return bytes[len(prefix):]. | Otherwise, return a copy of the original bytes. | | removesuffix(self, suffix, /) | Return a bytes object with the given suffix string removed if present. | | If the bytes ends with the suffix string and that suffix is not empty, | return bytes[:-len(prefix)]. Otherwise, return a copy of the original | bytes. | | replace(self, old, new, count=-1, /) | Return a copy with all occurrences of substring old replaced by new. | | count | Maximum number of occurrences to replace. | -1 (the default value) means replace all occurrences. | | If the optional argument count is given, only the first count occurrences are | replaced. | | rfind(...) | B.rfind(sub[, start[, end]]) -> int | | Return the highest index in B where subsection sub is found, | such that sub is contained within B[start,end]. Optional | arguments start and end are interpreted as in slice notation. | | Return -1 on failure. | | rindex(...) | B.rindex(sub[, start[, end]]) -> int | | Return the highest index in B where subsection sub is found, | such that sub is contained within B[start,end]. Optional | arguments start and end are interpreted as in slice notation. | | Raise ValueError when the subsection is not found. | | rjust(self, width, fillchar=b' ', /) | Return a right-justified string of length width. | | Padding is done using the specified fill character. | | rpartition(self, sep, /) | Partition the bytes into three parts using the given separator. | | This will search for the separator sep in the bytes, starting at the end. If | the separator is found, returns a 3-tuple containing the part before the | separator, the separator itself, and the part after it. | | If the separator is not found, returns a 3-tuple containing two empty bytes | objects and the original bytes object. | | rsplit(self, /, sep=None, maxsplit=-1) | Return a list of the sections in the bytes, using sep as the delimiter. | | sep | The delimiter according which to split the bytes. | None (the default value) means split on ASCII whitespace characters | (space, tab, return, newline, formfeed, vertical tab). | maxsplit | Maximum number of splits to do. | -1 (the default value) means no limit. | | Splitting is done starting at the end of the bytes and working to the front. | | rstrip(self, bytes=None, /) | Strip trailing bytes contained in the argument. | | If the argument is omitted or None, strip trailing ASCII whitespace. | | split(self, /, sep=None, maxsplit=-1) | Return a list of the sections in the bytes, using sep as the delimiter. | | sep | The delimiter according which to split the bytes. | None (the default value) means split on ASCII whitespace characters | (space, tab, return, newline, formfeed, vertical tab). | maxsplit | Maximum number of splits to do. | -1 (the default value) means no limit. | | splitlines(self, /, keepends=False) | Return a list of the lines in the bytes, breaking at line boundaries. | | Line breaks are not included in the resulting list unless keepends is given and | true. | | startswith(...) | B.startswith(prefix[, start[, end]]) -> bool | | Return True if B starts with the specified prefix, False otherwise. | With optional start, test B beginning at that position. | With optional end, stop comparing B at that position. | prefix can also be a tuple of bytes to try. | | strip(self, bytes=None, /) | Strip leading and trailing bytes contained in the argument. | | If the argument is omitted or None, strip leading and trailing ASCII whitespace. | | swapcase(...) | B.swapcase() -> copy of B | | Return a copy of B with uppercase ASCII characters converted | to lowercase ASCII and vice versa. | | title(...) | B.title() -> copy of B | | Return a titlecased version of B, i.e. ASCII words start with uppercase | characters, all remaining cased characters have lowercase. | | translate(self, table, /, delete=b'') | Return a copy with each character mapped by the given translation table. | | table | Translation table, which must be a bytes object of length 256. | | All characters occurring in the optional argument delete are removed. | The remaining characters are mapped through the given translation table. | | upper(...) | B.upper() -> copy of B | | Return a copy of B with all ASCII characters converted to uppercase. | | zfill(self, width, /) | Pad a numeric string with zeros on the left, to fill a field of the given width. | | The original string is never truncated. | | ---------------------------------------------------------------------- | Class methods inherited from builtins.bytes: | | fromhex(string, /) from builtins.type | Create a bytes object from a string of hexadecimal numbers. | | Spaces between two numbers are accepted. | Example: bytes.fromhex('B9 01EF') -> b'\\xb9\\x01\\xef'. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.bytes: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | maketrans(frm, to, /) | Return a translation table useable for the bytes or bytearray translate method. | | The returned table will be one where each byte in frm is mapped to the byte at | the same position in to. | | The bytes objects frm and to must be of the same length. class Connection(builtins.object) | Connection(cnx) | | Connection object. | | Methods defined here: | | __enter__(self) | Enter the runtime context for the connection object. | | The runtime context can be used for running transactions. | | This also starts a transaction in autocommit mode. | | __exit__(self, et, ev, tb) | Exit the runtime context for the connection object. | | This does not close the connection, but it ends a transaction. | | __init__(self, cnx) | Create a database connection object. | | close(self) | Close the connection object. | | commit(self) | Commit any pending transaction to the database. | | cursor(self) | Return a new cursor object using the connection. | | execute(self, operation, params=None) | Shortcut method to run an operation on an implicit cursor. | | executemany(self, operation, param_seq) | Shortcut method to run an operation against a sequence. | | rollback(self) | Roll back to the start of any pending transaction. | | ---------------------------------------------------------------------- | Readonly properties defined here: | | closed | Check whether the connection has been closed or is broken. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | DataError = <class 'pg.DataError'> | | DatabaseError = <class 'pg.DatabaseError'> | | Error = <class 'pg.Error'> | | IntegrityError = <class 'pg.IntegrityError'> | | InterfaceError = <class 'pg.InterfaceError'> | | InternalError = <class 'pg.InternalError'> | | NotSupportedError = <class 'pg.NotSupportedError'> | | OperationalError = <class 'pg.OperationalError'> | | ProgrammingError = <class 'pg.ProgrammingError'> | | Warning = <class 'pg.Warning'> class Cursor(builtins.object) | Cursor(dbcnx) | | Cursor object. | | Methods defined here: | | __enter__(self) | Enter the runtime context for the cursor object. | | __exit__(self, et, ev, tb) | Exit the runtime context for the cursor object. | | __init__(self, dbcnx) | Create a cursor object for the database connection. | | __iter__(self) | Make cursor compatible to the iteration protocol. | | __next__(self) | Return the next row (support for the iteration protocol). | | build_row_factory(self) | Build a row factory based on the current description. | | This implementation builds a row factory for creating named tuples. | You can overwrite this method if you want to dynamically create | different row factories whenever the column description changes. | | callproc(self, procname, parameters=None) | Call a stored database procedure with the given name. | | The sequence of parameters must contain one entry for each input | argument that the procedure expects. The result of the call is the | same as this input sequence; replacement of output and input/output | parameters in the return value is currently not supported. | | The procedure may also provide a result set as output. These can be | requested through the standard fetch methods of the cursor. | | close(self) | Close the cursor object. | | copy_from(self, stream, table, format=None, sep=None, null=None, size=None, columns=None) | Copy data from an input stream to the specified table. | | The input stream can be a file-like object with a read() method or | it can also be an iterable returning a row or multiple rows of input | on each iteration. | | The format must be text, csv or binary. The sep option sets the | column separator (delimiter) used in the non binary formats. | The null option sets the textual representation of NULL in the input. | | The size option sets the size of the buffer used when reading data | from file-like objects. | | The copy operation can be restricted to a subset of columns. If no | columns are specified, all of them will be copied. | | copy_to(self, stream, table, format=None, sep=None, null=None, decode=None, columns=None) | Copy data from the specified table to an output stream. | | The output stream can be a file-like object with a write() method or | it can also be None, in which case the method will return a generator | yielding a row on each iteration. | | Output will be returned as byte strings unless you set decode to true. | | Note that you can also use a select query instead of the table name. | | The format must be text, csv or binary. The sep option sets the | column separator (delimiter) used in the non binary formats. | The null option sets the textual representation of NULL in the output. | | The copy operation can be restricted to a subset of columns. If no | columns are specified, all of them will be copied. | | execute(self, operation, parameters=None) | Prepare and execute a database operation (query or command). | | executemany(self, operation, seq_of_parameters) | Prepare operation and execute it against a parameter sequence. | | fetchall(self) | Fetch all (remaining) rows of a query result. | | fetchmany(self, size=None, keep=False) | Fetch the next set of rows of a query result. | | The number of rows to fetch per call is specified by the | size parameter. If it is not given, the cursor's arraysize | determines the number of rows to be fetched. If you set | the keep parameter to true, this is kept as new arraysize. | | fetchone(self) | Fetch the next row of a query result set. | | next = __next__(self) | | ---------------------------------------------------------------------- | Static methods defined here: | | nextset() | Not supported. | | row_factory(row) | Process rows before they are returned. | | You can overwrite this statically with a custom row factory, or | you can build a row factory dynamically with build_row_factory(). | | For example, you can create a Cursor class that returns rows as | Python dictionaries like this: | | class DictCursor(pgdb.Cursor): | | def row_factory(self, row): | return {desc[0]: value | for desc, value in zip(self.description, row)} | | cur = DictCursor(con) # get one DictCursor instance or | con.cursor_type = DictCursor # always use DictCursor instances | | setinputsizes(sizes) | Not supported. | | setoutputsize(size, column=0) | Not supported. | | ---------------------------------------------------------------------- | Readonly properties defined here: | | colnames | Unofficial convenience method for getting the column names. | | coltypes | Unofficial convenience method for getting the column types. | | description | Read-only attribute describing the result columns. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class DataError(DatabaseError) | Method resolution order: | DataError | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class DatabaseError(Error) | Method resolution order: | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class Error(builtins.Exception) | Method resolution order: | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class Hstore(builtins.dict) | Wrapper class for marking hstore values. | | Method resolution order: | Hstore | builtins.dict | builtins.object | | Methods defined here: | | __str__(self) | Return str(self). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.dict: | | __contains__(self, key, /) | True if the dictionary has the specified key, else False. | | __delitem__(self, key, /) | Delete self[key]. | | __eq__(self, value, /) | Return self==value. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __gt__(self, value, /) | Return self>value. | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | __ior__(self, value, /) | Return self|=value. | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __len__(self, /) | Return len(self). | | __lt__(self, value, /) | Return self<value. | | __ne__(self, value, /) | Return self!=value. | | __or__(self, value, /) | Return self|value. | | __repr__(self, /) | Return repr(self). | | __reversed__(self, /) | Return a reverse iterator over the dict keys. | | __ror__(self, value, /) | Return value|self. | | __setitem__(self, key, value, /) | Set self[key] to value. | | __sizeof__(...) | D.__sizeof__() -> size of D in memory, in bytes | | clear(...) | D.clear() -> None. Remove all items from D. | | copy(...) | D.copy() -> a shallow copy of D | | get(self, key, default=None, /) | Return the value for key if key is in the dictionary, else default. | | items(...) | D.items() -> a set-like object providing a view on D's items | | keys(...) | D.keys() -> a set-like object providing a view on D's keys | | pop(...) | D.pop(k[,d]) -> v, remove specified key and return the corresponding value. | | If the key is not found, return the default if given; otherwise, | raise a KeyError. | | popitem(self, /) | Remove and return a (key, value) pair as a 2-tuple. | | Pairs are returned in LIFO (last-in, first-out) order. | Raises KeyError if the dict is empty. | | setdefault(self, key, default=None, /) | Insert key with a value of default if key is not in the dictionary. | | Return the value for key if key is in the dictionary, else default. | | update(...) | D.update([E, ]**F) -> None. Update D from dict/iterable E and F. | If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] | If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v | In either case, this is followed by: for k in F: D[k] = F[k] | | values(...) | D.values() -> an object providing a view on D's values | | ---------------------------------------------------------------------- | Class methods inherited from builtins.dict: | | __class_getitem__(...) from builtins.type | See PEP 585 | | fromkeys(iterable, value=None, /) from builtins.type | Create a new dictionary with keys from iterable and values set to value. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.dict: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data and other attributes inherited from builtins.dict: | | __hash__ = None class IntegrityError(DatabaseError) | Method resolution order: | IntegrityError | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class InterfaceError(Error) | Method resolution order: | InterfaceError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class Json(builtins.object) | Json(obj, encode=None) | | Construct a wrapper for holding an object serializable to JSON. | | Methods defined here: | | __init__(self, obj, encode=None) | Initialize self. See help(type(self)) for accurate signature. | | __str__(self) | Return str(self). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class Literal(builtins.object) | Literal(sql) | | Construct a wrapper for holding a literal SQL string. | | Methods defined here: | | __init__(self, sql) | Initialize self. See help(type(self)) for accurate signature. | | __pg_repr__ = __str__(self) | | __str__(self) | Return str(self). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class NotSupportedError(DatabaseError) | Method resolution order: | NotSupportedError | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class OperationalError(DatabaseError) | Method resolution order: | OperationalError | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class ProgrammingError(DatabaseError) | Method resolution order: | ProgrammingError | DatabaseError | Error | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors inherited from Error: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class Type(builtins.frozenset) | Type(values) | | Type class for a couple of PostgreSQL data types. | | PostgreSQL is object-oriented: types are dynamic. | We must thus use type names as internal type codes. | | Method resolution order: | Type | builtins.frozenset | builtins.object | | Methods defined here: | | __eq__(self, other) | Return self==value. | | __ne__(self, other) | Return self!=value. | | ---------------------------------------------------------------------- | Static methods defined here: | | __new__(cls, values) | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None | | ---------------------------------------------------------------------- | Methods inherited from builtins.frozenset: | | __and__(self, value, /) | Return self&value. | | __contains__(...) | x.__contains__(y) <==> y in x. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __gt__(self, value, /) | Return self>value. | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __len__(self, /) | Return len(self). | | __lt__(self, value, /) | Return self<value. | | __or__(self, value, /) | Return self|value. | | __rand__(self, value, /) | Return value&self. | | __reduce__(...) | Return state information for pickling. | | __repr__(self, /) | Return repr(self). | | __ror__(self, value, /) | Return value|self. | | __rsub__(self, value, /) | Return value-self. | | __rxor__(self, value, /) | Return value^self. | | __sizeof__(...) | S.__sizeof__() -> size of S in memory, in bytes | | __sub__(self, value, /) | Return self-value. | | __xor__(self, value, /) | Return self^value. | | copy(...) | Return a shallow copy of a set. | | difference(...) | Return the difference of two or more sets as a new set. | | (i.e. all elements that are in this set but not the others.) | | intersection(...) | Return the intersection of two sets as a new set. | | (i.e. all elements that are in both sets.) | | isdisjoint(...) | Return True if two sets have a null intersection. | | issubset(...) | Report whether another set contains this set. | | issuperset(...) | Report whether this set contains another set. | | symmetric_difference(...) | Return the symmetric difference of two sets as a new set. | | (i.e. all elements that are in exactly one of the sets.) | | union(...) | Return the union of sets as a new set. | | (i.e. all elements that are in either set.) | | ---------------------------------------------------------------------- | Class methods inherited from builtins.frozenset: | | __class_getitem__(...) from builtins.type | See PEP 585 Uuid = class UUID(builtins.object) | Uuid(hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=<SafeUUID.unknown: None>) | | Instances of the UUID class represent UUIDs as specified in RFC 4122. | UUID objects are immutable, hashable, and usable as dictionary keys. | Converting a UUID to a string with str() yields something in the form | '12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts | five possible forms: a similar string of hexadecimal digits, or a tuple | of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and | 48-bit values respectively) as an argument named 'fields', or a string | of 16 bytes (with all the integer fields in big-endian order) as an | argument named 'bytes', or a string of 16 bytes (with the first three | fields in little-endian order) as an argument named 'bytes_le', or a | single 128-bit integer as an argument named 'int'. | | UUIDs have these read-only attributes: | | bytes the UUID as a 16-byte string (containing the six | integer fields in big-endian byte order) | | bytes_le the UUID as a 16-byte string (with time_low, time_mid, | and time_hi_version in little-endian byte order) | | fields a tuple of the six integer fields of the UUID, | which are also available as six individual attributes | and two derived attributes: | | time_low the first 32 bits of the UUID | time_mid the next 16 bits of the UUID | time_hi_version the next 16 bits of the UUID | clock_seq_hi_variant the next 8 bits of the UUID | clock_seq_low the next 8 bits of the UUID | node the last 48 bits of the UUID | | time the 60-bit timestamp | clock_seq the 14-bit sequence number | | hex the UUID as a 32-character hexadecimal string | | int the UUID as a 128-bit integer | | urn the UUID as a URN as specified in RFC 4122 | | variant the UUID variant (one of the constants RESERVED_NCS, | RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE) | | version the UUID version number (1 through 5, meaningful only | when the variant is RFC_4122) | | is_safe An enum indicating whether the UUID has been generated in | a way that is safe for multiprocessing applications, via | uuid_generate_time_safe(3). | | Methods defined here: | | __eq__(self, other) | Return self==value. | | __ge__(self, other) | Return self>=value. | | __getstate__(self) | | __gt__(self, other) | Return self>value. | | __hash__(self) | Return hash(self). | | __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=<SafeUUID.unknown: None>) | Create a UUID from either a string of 32 hexadecimal digits, | a string of 16 bytes as the 'bytes' argument, a string of 16 bytes | in little-endian order as the 'bytes_le' argument, a tuple of six | integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, | 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as | the 'fields' argument, or a single 128-bit integer as the 'int' | argument. When a string of hex digits is given, curly braces, | hyphens, and a URN prefix are all optional. For example, these | expressions all yield the same UUID: | | UUID('{12345678-1234-5678-1234-567812345678}') | UUID('12345678123456781234567812345678') | UUID('urn:uuid:12345678-1234-5678-1234-567812345678') | UUID(bytes='\x12\x34\x56\x78'*4) | UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + | '\x12\x34\x56\x78\x12\x34\x56\x78') | UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) | UUID(int=0x12345678123456781234567812345678) | | Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must | be given. The 'version' argument is optional; if given, the resulting | UUID will have its variant and version set according to RFC 4122, | overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'. | | is_safe is an enum exposed as an attribute on the instance. It | indicates whether the UUID has been generated in a way that is safe | for multiprocessing applications, via uuid_generate_time_safe(3). | | __int__(self) | | __le__(self, other) | Return self<=value. | | __lt__(self, other) | Return self<value. | | __repr__(self) | Return repr(self). | | __setattr__(self, name, value) | Implement setattr(self, name, value). | | __setstate__(self, state) | | __str__(self) | Return str(self). | | ---------------------------------------------------------------------- | Readonly properties defined here: | | bytes | | bytes_le | | clock_seq | | clock_seq_hi_variant | | clock_seq_low | | fields | | hex | | node | | time | | time_hi_version | | time_low | | time_mid | | urn | | variant | | version | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | int | | is_safe class Warning(builtins.Exception) | Method resolution order: | Warning | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args FUNCTIONS Date(year, month, day) Construct an object holding a date value. DateFromTicks(ticks) Construct an object holding a date value from the given ticks value. Interval(days, hours=0, minutes=0, seconds=0, microseconds=0) Construct an object holding a time interval value. Time(hour, minute=0, second=0, microsecond=0, tzinfo=None) Construct an object holding a time value. TimeFromTicks(ticks) Construct an object holding a time value from the given ticks value. Timestamp(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None) Construct an object holding a time stamp value. TimestampFromTicks(ticks) Construct an object holding a time stamp from the given ticks value. connect(dsn=None, user=None, password=None, host=None, database=None, **kwargs) Connect to a database. get_typecast(typ) Get the global typecast function for the given database type(s). reset_typecast(typ=None) Reset the global typecasts for the given type(s) to their default. When no type is specified, all typecasts will be reset. Note that connections cache cast functions. To be sure a global change is picked up by a running connection, call con.type_cache.reset_typecast(). set_typecast(typ, cast) Set a global typecast function for the given database type(s). Note that connections cache cast functions. To be sure a global change is picked up by a running connection, call con.type_cache.reset_typecast(). DATA ARRAY = <pgdb.ArrayType object> BINARY = Type({'bytea'}) BOOL = Type({'bool'}) DATE = Type({'date'}) DATETIME = Type({'abstime', 'date', 'timetz', 'timestamptz', 'time', '... FLOAT = Type({'float4', 'float8'}) HSTORE = Type({'hstore'}) INTEGER = Type({'int8', 'serial', 'int4', 'int2'}) INTERVAL = Type({'interval'}) JSON = Type({'jsonb', 'json'}) LONG = Type({'int8'}) MONEY = Type({'money'}) NUMBER = Type({'numeric', 'serial', 'money', 'int2', 'float8', 'int8',... NUMERIC = Type({'numeric'}) RECORD = <pgdb.RecordType object> ROWID = Type({'oid'}) SMALLINT = Type({'int2'}) STRING = Type({'name', 'varchar', 'text', 'char', 'bpchar'}) TIME = Type({'time', 'timetz'}) TIMESTAMP = Type({'timestamptz', 'timestamp'}) UUID = Type({'uuid'}) __all__ = ['Connection', 'Cursor', 'Date', 'Time', 'Timestamp', 'DateF... apilevel = '2.0' paramstyle = 'pyformat' threadsafety = 1 version = '5.1.2' VERSION 5.1.2 FILE /usr/lib/python3/dist-packages/pgdb.py
Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:13 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)