{
    "content": [
        {
            "type": "text",
            "text": "# _pg (pydoc)\n\n**Summary:** pg - Python interface to PostgreSQL DB\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **CLASSES** (15 lines) — 13 subsections\n  - class DataError (69 lines)\n  - class DatabaseError (68 lines)\n  - class Error (67 lines)\n  - class IntegrityError (69 lines)\n  - class InterfaceError (68 lines)\n  - class InternalError (69 lines)\n  - class InvalidResultError (70 lines)\n  - class MultipleResultsError (71 lines)\n  - class NoResultError (71 lines)\n  - class NotSupportedError (69 lines)\n  - class OperationalError (69 lines)\n  - class ProgrammingError (69 lines)\n  - class Warning (67 lines)\n- **FUNCTIONS** (1 lines) — 33 subsections\n  - cast_array (2 lines)\n  - cast_hstore (2 lines)\n  - cast_record (2 lines)\n  - connect (4 lines)\n  - escape_bytea (2 lines)\n  - escape_string (2 lines)\n  - get_array (2 lines)\n  - get_bool (2 lines)\n  - get_bytea_escaped (2 lines)\n  - get_datestyle (2 lines)\n  - get_decimal (2 lines)\n  - get_decimal_point (2 lines)\n  - get_defbase (2 lines)\n  - get_defhost (2 lines)\n  - get_defopt (2 lines)\n  - get_defport (2 lines)\n  - get_defuser (2 lines)\n  - get_jsondecode (2 lines)\n  - set_array (2 lines)\n  - set_bool (2 lines)\n  - set_bytea_escaped (2 lines)\n  - set_datestyle (2 lines)\n  - set_decimal (2 lines)\n  - set_decimal_point (2 lines)\n  - set_defbase (2 lines)\n  - set_defhost (2 lines)\n  - set_defopt (2 lines)\n  - set_defpasswd (2 lines)\n  - set_defport (2 lines)\n  - set_defuser (2 lines)\n  - set_jsondecode (2 lines)\n  - set_query_helpers (2 lines)\n  - unescape_bytea (2 lines)\n- **DATA** (16 lines)\n- **VERSION** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\npg - Python interface to PostgreSQL DB\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\npg.Error\npg.DatabaseError\npg.DataError\npg.InvalidResultError\npg.MultipleResultsError\npg.NoResultError\npg.IntegrityError\npg.InternalError\npg.NotSupportedError\npg.OperationalError\npg.ProgrammingError\npg.InterfaceError\npg.Warning\n\n#### class DataError\n\n|  Method resolution order:\n|      DataError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class DatabaseError\n\n|  Method resolution order:\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Error\n\n|  Method resolution order:\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class IntegrityError\n\n|  Method resolution order:\n|      IntegrityError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class InterfaceError\n\n|  Method resolution order:\n|      InterfaceError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class InternalError\n\n|  Method resolution order:\n|      InternalError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class InvalidResultError\n\n|  Method resolution order:\n|      InvalidResultError\n|      DataError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class MultipleResultsError\n\n|  Method resolution order:\n|      MultipleResultsError\n|      InvalidResultError\n|      DataError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class NoResultError\n\n|  Method resolution order:\n|      NoResultError\n|      InvalidResultError\n|      DataError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class NotSupportedError\n\n|  Method resolution order:\n|      NotSupportedError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class OperationalError\n\n|  Method resolution order:\n|      OperationalError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class ProgrammingError\n\n|  Method resolution order:\n|      ProgrammingError\n|      DatabaseError\n|      Error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from Error:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Warning\n\n|  Method resolution order:\n|      Warning\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n### FUNCTIONS\n\n#### cast_array\n\ncastarray(string, cast=None, delim=',') -- cast a string as an array\n\n#### cast_hstore\n\ncasthstore(string) -- cast a string as an hstore\n\n#### cast_record\n\ncastrecord(string, cast=None, delim=',') -- cast a string as a record\n\n#### connect\n\nconnect(dbname, host, port, opt) -- connect to a PostgreSQL database\n\nThe connection uses the specified parameters (optional, keywords aware).\n\n#### escape_bytea\n\nescapebytea(data) -- escape binary data for use within SQL as type bytea\n\n#### escape_string\n\nescapestring(string) -- escape a string for use within SQL\n\n#### get_array\n\ngetarray() -- check whether arrays are converted as lists\n\n#### get_bool\n\ngetbool() -- check whether boolean values are converted to bool\n\n#### get_bytea_escaped\n\ngetbyteaescaped() -- check whether bytea will be returned escaped\n\n#### get_datestyle\n\ngetdatestyle() -- get which date style is assumed\n\n#### get_decimal\n\ngetdecimal() -- get the decimal type to be used for numeric values\n\n#### get_decimal_point\n\ngetdecimalpoint() -- get decimal point to be used for money values\n\n#### get_defbase\n\ngetdefbase() -- return default database name\n\n#### get_defhost\n\ngetdefhost() -- return default database host\n\n#### get_defopt\n\ngetdefopt() -- return default database options\n\n#### get_defport\n\ngetdefport() -- return default database port\n\n#### get_defuser\n\ngetdefuser() -- return default database username\n\n#### get_jsondecode\n\ngetjsondecode() -- get the function used for decoding json results\n\n#### set_array\n\nsetarray(on) -- set whether arrays should be converted to lists\n\n#### set_bool\n\nsetbool(on) -- set whether boolean values should be converted to bool\n\n#### set_bytea_escaped\n\nsetbyteaescaped(on) -- set whether bytea will be returned escaped\n\n#### set_datestyle\n\nsetdatestyle(style) -- set which style is assumed\n\n#### set_decimal\n\nsetdecimal(cls) -- set a decimal type to be used for numeric values\n\n#### set_decimal_point\n\nsetdecimalpoint(char) -- set decimal point to be used for money values\n\n#### set_defbase\n\nsetdefbase(string) -- set default database name and return previous value\n\n#### set_defhost\n\nsetdefhost(string) -- set default database host and return previous value\n\n#### set_defopt\n\nsetdefopt(string) -- set default options and return previous value\n\n#### set_defpasswd\n\nsetdefpasswd(password) -- set default database password\n\n#### set_defport\n\nsetdefport(port) -- set default port and return previous value\n\n#### set_defuser\n\nsetdefuser(name) -- set default username and return previous value\n\n#### set_jsondecode\n\nsetjsondecode(func) -- set a function to be used for decoding json results\n\n#### set_query_helpers\n\nsetqueryhelpers(*helpers) -- set internal query helper functions\n\n#### unescape_bytea\n\nunescapebytea(string) -- unescape bytea data retrieved as text\n\n### DATA\n\nINVREAD = 262144\nINVWRITE = 131072\nRESULTDDL = 3\nRESULTDML = 2\nRESULTDQL = 4\nRESULTEMPTY = 1\nSEEKCUR = 1\nSEEKEND = 2\nSEEKSET = 0\nTRANSACTIVE = 1\nTRANSIDLE = 0\nTRANSINERROR = 3\nTRANSINTRANS = 2\nTRANSUNKNOWN = 4\nversion = '5.1.2'\n\n### VERSION\n\n5.1.2\n\n### FILE\n\n/usr/lib/python3/dist-packages/pg.cpython-310-x8664-linux-gnu.so\n\n"
        }
    ],
    "structuredContent": {
        "command": "_pg",
        "section": "",
        "mode": "pydoc",
        "summary": "pg - Python interface to PostgreSQL DB",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 15,
                "subsections": [
                    {
                        "name": "class DataError",
                        "lines": 69
                    },
                    {
                        "name": "class DatabaseError",
                        "lines": 68
                    },
                    {
                        "name": "class Error",
                        "lines": 67
                    },
                    {
                        "name": "class IntegrityError",
                        "lines": 69
                    },
                    {
                        "name": "class InterfaceError",
                        "lines": 68
                    },
                    {
                        "name": "class InternalError",
                        "lines": 69
                    },
                    {
                        "name": "class InvalidResultError",
                        "lines": 70
                    },
                    {
                        "name": "class MultipleResultsError",
                        "lines": 71
                    },
                    {
                        "name": "class NoResultError",
                        "lines": 71
                    },
                    {
                        "name": "class NotSupportedError",
                        "lines": 69
                    },
                    {
                        "name": "class OperationalError",
                        "lines": 69
                    },
                    {
                        "name": "class ProgrammingError",
                        "lines": 69
                    },
                    {
                        "name": "class Warning",
                        "lines": 67
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "cast_array",
                        "lines": 2
                    },
                    {
                        "name": "cast_hstore",
                        "lines": 2
                    },
                    {
                        "name": "cast_record",
                        "lines": 2
                    },
                    {
                        "name": "connect",
                        "lines": 4
                    },
                    {
                        "name": "escape_bytea",
                        "lines": 2
                    },
                    {
                        "name": "escape_string",
                        "lines": 2
                    },
                    {
                        "name": "get_array",
                        "lines": 2
                    },
                    {
                        "name": "get_bool",
                        "lines": 2
                    },
                    {
                        "name": "get_bytea_escaped",
                        "lines": 2
                    },
                    {
                        "name": "get_datestyle",
                        "lines": 2
                    },
                    {
                        "name": "get_decimal",
                        "lines": 2
                    },
                    {
                        "name": "get_decimal_point",
                        "lines": 2
                    },
                    {
                        "name": "get_defbase",
                        "lines": 2
                    },
                    {
                        "name": "get_defhost",
                        "lines": 2
                    },
                    {
                        "name": "get_defopt",
                        "lines": 2
                    },
                    {
                        "name": "get_defport",
                        "lines": 2
                    },
                    {
                        "name": "get_defuser",
                        "lines": 2
                    },
                    {
                        "name": "get_jsondecode",
                        "lines": 2
                    },
                    {
                        "name": "set_array",
                        "lines": 2
                    },
                    {
                        "name": "set_bool",
                        "lines": 2
                    },
                    {
                        "name": "set_bytea_escaped",
                        "lines": 2
                    },
                    {
                        "name": "set_datestyle",
                        "lines": 2
                    },
                    {
                        "name": "set_decimal",
                        "lines": 2
                    },
                    {
                        "name": "set_decimal_point",
                        "lines": 2
                    },
                    {
                        "name": "set_defbase",
                        "lines": 2
                    },
                    {
                        "name": "set_defhost",
                        "lines": 2
                    },
                    {
                        "name": "set_defopt",
                        "lines": 2
                    },
                    {
                        "name": "set_defpasswd",
                        "lines": 2
                    },
                    {
                        "name": "set_defport",
                        "lines": 2
                    },
                    {
                        "name": "set_defuser",
                        "lines": 2
                    },
                    {
                        "name": "set_jsondecode",
                        "lines": 2
                    },
                    {
                        "name": "set_query_helpers",
                        "lines": 2
                    },
                    {
                        "name": "unescape_bytea",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}