diff --git a/AUTHORS b/AUTHORS index 76b74a12..0373c8b8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,9 @@ Contributors: - James William Pye + James William Pye [faults are mostly mine] Elvis Pranskevichus William Grzybowski [subjective paramstyle] + Barry Grussling [inet/cidr support] + Matthew Grant [inet/cidr support] Support by Donation: AppCove Network diff --git a/postgresql/__init__.py b/postgresql/__init__.py index d4ae6503..b96607d0 100644 --- a/postgresql/__init__.py +++ b/postgresql/__init__.py @@ -21,6 +21,12 @@ 'open', ] +#: The version string of py-postgresql. +version = '' # overridden by subsequent import from .project. + +#: The version triple of py-postgresql: (major, minor, patch). +version_info = () # overridden by subsequent import from .project. + # Optional. try: from .project import version_info, version, \ diff --git a/postgresql/api.py b/postgresql/api.py index b5392cce..5cfed8c9 100644 --- a/postgresql/api.py +++ b/postgresql/api.py @@ -22,7 +22,6 @@ 'Message', 'Statement', 'Chunks', - 'Rows', 'Cursor', 'Connector', 'Category', diff --git a/postgresql/cluster.py b/postgresql/cluster.py index 2875a9a5..5ceb18b3 100644 --- a/postgresql/cluster.py +++ b/postgresql/cluster.py @@ -513,10 +513,10 @@ def address(self): d = self.settings.getset(( 'listen_addresses', 'port', )) - if 'listen_addresses' in d: + if d.get('listen_addresses') is not None: # Prefer localhost over other addresses. # More likely to get a successful connection. - addrs = d.get('listen_addresses', 'localhost').lower().split(',') + addrs = d.get('listen_addresses').lower().split(',') if 'localhost' in addrs or '*' in addrs: host = 'localhost' elif '127.0.0.1' in addrs: @@ -539,14 +539,14 @@ def ready_for_connections(self): return False e = None host, port = self.address() + connection = self.driver.fit( + user = ' -*- ping -*- ', + host = host, port = port, + database = 'template1', + sslmode = 'disable', + )() try: - self.driver.connect( - user = ' -*- ping -*- ', - host = host or 'localhost', - port = port or 5432, - database = 'template1', - sslmode = 'disable', - ).close() + connection.connect() except pg_exc.ClientCannotConnectError as err: for attempt in err.database.failures: x = attempt.error diff --git a/postgresql/documentation/changes.txt b/postgresql/documentation/changes-v1.0.txt similarity index 76% rename from postgresql/documentation/changes.txt rename to postgresql/documentation/changes-v1.0.txt index 4de9a2da..04a9c63c 100644 --- a/postgresql/documentation/changes.txt +++ b/postgresql/documentation/changes-v1.0.txt @@ -1,9 +1,25 @@ -Changes -======= +Changes in v1.0 +=============== -1.0.3 in development +1.0.4 in development -------------------- + * Fix usage of weakrefs for statement/cursor GC. (Elvis Pranskevichus) + (Fixes mysterious DuplicateCursorError exceptions) + * Add support for binary inet/cidr/macaddr types for use with arrays and composites. (Matthew Grant & Barry Grussling) + * Add support for (un)pickling postgresql.types.Array objects. (Elvis Pranskevichus) + * Alter how changes are represented in documentation to simplify merging. + +1.0.3 released on 2011-09-24 +---------------------------- + + * Use raise x from y to generalize exceptions. (Elvis Pranskevichus) + * Alter postgresql.string.quote_ident to always quote. (Elvis Pranskevichus) + * Add postgresql.string.quote_ident_if_necessary (Modification of Elvis Pranskevichus' patch) + * Many postgresql.string bug fixes (Elvis Pranskevichus) + * Correct ResourceWarnings improving Python 3.2 support. (jwp) + * Add test command to setup.py (Elvis Pranskevichus) + 1.0.2 released on 2010-09-18 ---------------------------- diff --git a/postgresql/documentation/changes.py b/postgresql/documentation/changes.py index 47588282..8060d7a7 100644 --- a/postgresql/documentation/changes.py +++ b/postgresql/documentation/changes.py @@ -1,7 +1,10 @@ ## # .documentation.changes ## -__doc__ = open(__file__[:__file__.rfind('.')] + '.txt').read() +from .. import project +# It's a bit lame, but let's not get too fancy. +bid = '.'.join(project.version_info[0:1]) +__doc__ = open(__file__[:__file__.rfind('.')] + '-v' + bid + '.txt').read() __docformat__ = 'reStructuredText' if __name__ == '__main__': help(__name__) diff --git a/postgresql/documentation/html/.gitignore b/postgresql/documentation/html/.gitignore deleted file mode 100644 index 02d00bbb..00000000 --- a/postgresql/documentation/html/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.buildinfo -objects.inv diff --git a/postgresql/documentation/html/_sources/changes.txt b/postgresql/documentation/html/_sources/changes-v1.0.txt similarity index 76% rename from postgresql/documentation/html/_sources/changes.txt rename to postgresql/documentation/html/_sources/changes-v1.0.txt index 4afe2ee0..04a9c63c 100644 --- a/postgresql/documentation/html/_sources/changes.txt +++ b/postgresql/documentation/html/_sources/changes-v1.0.txt @@ -1,5 +1,24 @@ -Changes -======= +Changes in v1.0 +=============== + +1.0.4 in development +-------------------- + + * Fix usage of weakrefs for statement/cursor GC. (Elvis Pranskevichus) + (Fixes mysterious DuplicateCursorError exceptions) + * Add support for binary inet/cidr/macaddr types for use with arrays and composites. (Matthew Grant & Barry Grussling) + * Add support for (un)pickling postgresql.types.Array objects. (Elvis Pranskevichus) + * Alter how changes are represented in documentation to simplify merging. + +1.0.3 released on 2011-09-24 +---------------------------- + + * Use raise x from y to generalize exceptions. (Elvis Pranskevichus) + * Alter postgresql.string.quote_ident to always quote. (Elvis Pranskevichus) + * Add postgresql.string.quote_ident_if_necessary (Modification of Elvis Pranskevichus' patch) + * Many postgresql.string bug fixes (Elvis Pranskevichus) + * Correct ResourceWarnings improving Python 3.2 support. (jwp) + * Add test command to setup.py (Elvis Pranskevichus) 1.0.2 released on 2010-09-18 ---------------------------- diff --git a/postgresql/documentation/html/_sources/copyman.txt b/postgresql/documentation/html/_sources/copyman.txt index 7fab080b..37304937 100644 --- a/postgresql/documentation/html/_sources/copyman.txt +++ b/postgresql/documentation/html/_sources/copyman.txt @@ -4,8 +4,6 @@ Copy Management *************** -.. warning:: `postgresql.copyman` is a new feature in v1.0. - The `postgresql.copyman` module provides a way to quickly move COPY data coming from one connection to many connections. Alternatively, it can be sourced by arbitrary iterators and target arbitrary callables. diff --git a/postgresql/documentation/html/_sources/index.txt b/postgresql/documentation/html/_sources/index.txt index 2ce60a55..d2d4c1e0 100644 --- a/postgresql/documentation/html/_sources/index.txt +++ b/postgresql/documentation/html/_sources/index.txt @@ -23,7 +23,6 @@ Contents lib clientparameters gotchas - changes Reference --------- @@ -32,6 +31,15 @@ Reference :maxdepth: 2 bin + modules + +Changes +------- + +.. toctree:: + :maxdepth: 1 + + changes-v1.0 Sample Code ----------- diff --git a/postgresql/documentation/html/_sources/modules.txt b/postgresql/documentation/html/_sources/modules.txt new file mode 100644 index 00000000..133ce779 --- /dev/null +++ b/postgresql/documentation/html/_sources/modules.txt @@ -0,0 +1,93 @@ +Modules +======= + +Modules intended for general use. + +:mod:`postgresql` +----------------- + +.. automodule:: postgresql +.. autodata:: version +.. autodata:: version_info +.. autofunction:: open + + +:mod:`postgresql.sys` +--------------------- + +.. automodule:: + postgresql.sys + :members: + :show-inheritance: + + +:mod:`postgresql.string` +------------------------ + +.. automodule:: + postgresql.string + :members: + :show-inheritance: + + +:mod:`postgresql.exceptions` +---------------------------- + +.. automodule:: + postgresql.exceptions + :members: + :show-inheritance: + + +:mod:`postgresql.temporal` +-------------------------- + +.. automodule:: + postgresql.temporal + :members: + :show-inheritance: + + +:mod:`postgresql.installation` +------------------------------ + +.. automodule:: + postgresql.installation + :members: + :show-inheritance: + + +:mod:`postgresql.cluster` +------------------------- + +.. automodule:: + postgresql.cluster + :members: + :show-inheritance: + + +:mod:`postgresql.copyman` +------------------------- + +.. automodule:: + postgresql.copyman + :members: + :show-inheritance: + + +:mod:`postgresql.alock` +----------------------- + +.. automodule:: + postgresql.alock + :members: + :show-inheritance: + + +:mod:`postgresql.api` +--------------------- + +.. automodule:: + postgresql.api + :members: + :show-inheritance: diff --git a/postgresql/documentation/html/_sources/notifyman.txt b/postgresql/documentation/html/_sources/notifyman.txt index f258adbe..d774ee52 100644 --- a/postgresql/documentation/html/_sources/notifyman.txt +++ b/postgresql/documentation/html/_sources/notifyman.txt @@ -4,8 +4,6 @@ Notification Management *********************** -.. warning:: `postgresql.notifyman` is a new feature in v1.0. - Relevant SQL commands: `NOTIFY `_, `LISTEN `_, `UNLISTEN `_. diff --git a/postgresql/documentation/html/_static/ajax-loader.gif b/postgresql/documentation/html/_static/ajax-loader.gif new file mode 100644 index 00000000..61faf8ca Binary files /dev/null and b/postgresql/documentation/html/_static/ajax-loader.gif differ diff --git a/postgresql/documentation/html/_static/basic.css b/postgresql/documentation/html/_static/basic.css index 69f30d4f..43e8bafa 100644 --- a/postgresql/documentation/html/_static/basic.css +++ b/postgresql/documentation/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -79,6 +79,14 @@ div.sphinxsidebar input { font-size: 1em; } +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + width: 30px; +} + img { border: 0; } @@ -213,12 +221,29 @@ p.rubric { font-weight: bold; } +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left; } .align-center { - clear: both; text-align: center; } @@ -395,7 +420,7 @@ dl.glossary dt { } .footnote:target { - background-color: #ffa + background-color: #ffa; } .line-block { @@ -422,10 +447,16 @@ dl.glossary dt { font-style: oblique; } +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ } td.linenos pre { @@ -506,4 +537,4 @@ span.eqno { #top-link { display: none; } -} +} \ No newline at end of file diff --git a/postgresql/documentation/html/_static/comment-bright.png b/postgresql/documentation/html/_static/comment-bright.png new file mode 100644 index 00000000..551517b8 Binary files /dev/null and b/postgresql/documentation/html/_static/comment-bright.png differ diff --git a/postgresql/documentation/html/_static/comment-close.png b/postgresql/documentation/html/_static/comment-close.png new file mode 100644 index 00000000..09b54be4 Binary files /dev/null and b/postgresql/documentation/html/_static/comment-close.png differ diff --git a/postgresql/documentation/html/_static/comment.png b/postgresql/documentation/html/_static/comment.png new file mode 100644 index 00000000..92feb52b Binary files /dev/null and b/postgresql/documentation/html/_static/comment.png differ diff --git a/postgresql/documentation/html/_static/default.css b/postgresql/documentation/html/_static/default.css index b30cb790..21f3f509 100644 --- a/postgresql/documentation/html/_static/default.css +++ b/postgresql/documentation/html/_static/default.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- default theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -114,6 +114,7 @@ div.sphinxsidebar input { } + /* -- hyperlink styles ------------------------------------------------------ */ a { diff --git a/postgresql/documentation/html/_static/doctools.js b/postgresql/documentation/html/_static/doctools.js index eeea95ea..d4619fdf 100644 --- a/postgresql/documentation/html/_static/doctools.js +++ b/postgresql/documentation/html/_static/doctools.js @@ -2,9 +2,9 @@ * doctools.js * ~~~~~~~~~~~ * - * Sphinx JavaScript utilties for all documentation. + * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -185,9 +185,9 @@ var Documentation = { body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); - $('') - .appendTo($('.sidebar .this-page-menu')); + $('') + .appendTo($('#searchbox')); } }, @@ -213,7 +213,7 @@ var Documentation = { * helper function to hide the search marks again */ hideSearchWords : function() { - $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, diff --git a/postgresql/documentation/html/_static/down-pressed.png b/postgresql/documentation/html/_static/down-pressed.png new file mode 100644 index 00000000..6f7ad782 Binary files /dev/null and b/postgresql/documentation/html/_static/down-pressed.png differ diff --git a/postgresql/documentation/html/_static/down.png b/postgresql/documentation/html/_static/down.png new file mode 100644 index 00000000..3003a887 Binary files /dev/null and b/postgresql/documentation/html/_static/down.png differ diff --git a/postgresql/documentation/html/_static/pygments.css b/postgresql/documentation/html/_static/pygments.css index 1f2d2b61..1a14f2ae 100644 --- a/postgresql/documentation/html/_static/pygments.css +++ b/postgresql/documentation/html/_static/pygments.css @@ -1,61 +1,62 @@ -.hll { background-color: #ffffcc } -.c { color: #408090; font-style: italic } /* Comment */ -.err { border: 1px solid #FF0000 } /* Error */ -.k { color: #007020; font-weight: bold } /* Keyword */ -.o { color: #666666 } /* Operator */ -.cm { color: #408090; font-style: italic } /* Comment.Multiline */ -.cp { color: #007020 } /* Comment.Preproc */ -.c1 { color: #408090; font-style: italic } /* Comment.Single */ -.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.gd { color: #A00000 } /* Generic.Deleted */ -.ge { font-style: italic } /* Generic.Emph */ -.gr { color: #FF0000 } /* Generic.Error */ -.gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.gi { color: #00A000 } /* Generic.Inserted */ -.go { color: #303030 } /* Generic.Output */ -.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.gs { font-weight: bold } /* Generic.Strong */ -.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.gt { color: #0040D0 } /* Generic.Traceback */ -.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.kp { color: #007020 } /* Keyword.Pseudo */ -.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.kt { color: #902000 } /* Keyword.Type */ -.m { color: #208050 } /* Literal.Number */ -.s { color: #4070a0 } /* Literal.String */ -.na { color: #4070a0 } /* Name.Attribute */ -.nb { color: #007020 } /* Name.Builtin */ -.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.no { color: #60add5 } /* Name.Constant */ -.nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.ne { color: #007020 } /* Name.Exception */ -.nf { color: #06287e } /* Name.Function */ -.nl { color: #002070; font-weight: bold } /* Name.Label */ -.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.nt { color: #062873; font-weight: bold } /* Name.Tag */ -.nv { color: #bb60d5 } /* Name.Variable */ -.ow { color: #007020; font-weight: bold } /* Operator.Word */ -.w { color: #bbbbbb } /* Text.Whitespace */ -.mf { color: #208050 } /* Literal.Number.Float */ -.mh { color: #208050 } /* Literal.Number.Hex */ -.mi { color: #208050 } /* Literal.Number.Integer */ -.mo { color: #208050 } /* Literal.Number.Oct */ -.sb { color: #4070a0 } /* Literal.String.Backtick */ -.sc { color: #4070a0 } /* Literal.String.Char */ -.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.s2 { color: #4070a0 } /* Literal.String.Double */ -.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.sh { color: #4070a0 } /* Literal.String.Heredoc */ -.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.sx { color: #c65d09 } /* Literal.String.Other */ -.sr { color: #235388 } /* Literal.String.Regex */ -.s1 { color: #4070a0 } /* Literal.String.Single */ -.ss { color: #517918 } /* Literal.String.Symbol */ -.bp { color: #007020 } /* Name.Builtin.Pseudo */ -.vc { color: #bb60d5 } /* Name.Variable.Class */ -.vg { color: #bb60d5 } /* Name.Variable.Global */ -.vi { color: #bb60d5 } /* Name.Variable.Instance */ -.il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #303030 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0040D0 } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/postgresql/documentation/html/_static/searchtools.js b/postgresql/documentation/html/_static/searchtools.js index 513a7bad..663be4c9 100644 --- a/postgresql/documentation/html/_static/searchtools.js +++ b/postgresql/documentation/html/_static/searchtools.js @@ -1,10 +1,10 @@ /* - * searchtools.js - * ~~~~~~~~~~~~~~ + * searchtools.js_t + * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -36,10 +36,11 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) { return rv; } + /** * Porter Stemmer */ -var PorterStemmer = function() { +var Stemmer = function() { var step2list = { ational: 'ate', @@ -300,20 +301,20 @@ var Search = { }, query : function(query) { - var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in', - 'if', 'for', 'no', 'there', 'their', 'was', 'is', - 'be', 'to', 'that', 'but', 'they', 'not', 'such', - 'with', 'by', 'a', 'on', 'these', 'of', 'will', - 'this', 'near', 'the', 'or', 'at']; - - // stem the searchterms and add them to the correct list - var stemmer = new PorterStemmer(); + var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"]; + + // Stem the searchterms and add them to the correct list + var stemmer = new Stemmer(); var searchterms = []; var excluded = []; var hlterms = []; var tmp = query.split(/\s+/); - var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null; + var objectterms = []; for (var i = 0; i < tmp.length; i++) { + if (tmp[i] != "") { + objectterms.push(tmp[i].toLowerCase()); + } + if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || tmp[i] == "") { // skip this "word" @@ -344,9 +345,6 @@ var Search = { var filenames = this._index.filenames; var titles = this._index.titles; var terms = this._index.terms; - var objects = this._index.objects; - var objtypes = this._index.objtypes; - var objnames = this._index.objnames; var fileMap = {}; var files = null; // different result priorities @@ -357,40 +355,19 @@ var Search = { $('#search-progress').empty(); // lookup as object - if (object != null) { - for (var prefix in objects) { - for (var name in objects[prefix]) { - var fullname = (prefix ? prefix + '.' : '') + name; - if (fullname.toLowerCase().indexOf(object) > -1) { - match = objects[prefix][name]; - descr = objnames[match[1]] + _(', in ') + titles[match[0]]; - // XXX the generated anchors are not generally correct - // XXX there may be custom prefixes - result = [filenames[match[0]], fullname, '#'+fullname, descr]; - switch (match[2]) { - case 1: objectResults.push(result); break; - case 0: importantResults.push(result); break; - case 2: unimportantResults.push(result); break; - } - } - } - } + for (var i = 0; i < objectterms.length; i++) { + var others = [].concat(objectterms.slice(0,i), + objectterms.slice(i+1, objectterms.length)) + var results = this.performObjectSearch(objectterms[i], others); + // Assume first word is most likely to be the object, + // other words more likely to be in description. + // Therefore put matches for earlier words first. + // (Results are eventually used in reverse order). + objectResults = results[0].concat(objectResults); + importantResults = results[1].concat(importantResults); + unimportantResults = results[2].concat(unimportantResults); } - // sort results descending - objectResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - importantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - unimportantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - // perform the search on the required terms for (var i = 0; i < searchterms.length; i++) { var word = searchterms[i]; @@ -456,10 +433,23 @@ var Search = { if (results.length) { var item = results.pop(); var listItem = $('
  • '); - listItem.append($('').attr( - 'href', - item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + - highlightstring + item[2]).html(item[1])); + if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { + // dirhtml builder + var dirname = item[0] + '/'; + if (dirname.match(/\/index\/$/)) { + dirname = dirname.substring(0, dirname.length-6); + } else if (dirname == 'index/') { + dirname = ''; + } + listItem.append($('').attr('href', + DOCUMENTATION_OPTIONS.URL_ROOT + dirname + + highlightstring + item[2]).html(item[1])); + } else { + // normal html builders + listItem.append($('').attr('href', + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + + highlightstring + item[2]).html(item[1])); + } if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); @@ -472,11 +462,11 @@ var Search = { if (data != '') { listItem.append($.makeSearchSummary(data, searchterms, hlterms)); Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); } - }); + listItem.slideDown(5, function() { + displayNextItem(); + }); + }, "text"); } else { // no source available, just display title Search.output.append(listItem); @@ -497,9 +487,74 @@ var Search = { } } displayNextItem(); + }, + + performObjectSearch : function(object, otherterms) { + var filenames = this._index.filenames; + var objects = this._index.objects; + var objnames = this._index.objnames; + var titles = this._index.titles; + + var importantResults = []; + var objectResults = []; + var unimportantResults = []; + + for (var prefix in objects) { + for (var name in objects[prefix]) { + var fullname = (prefix ? prefix + '.' : '') + name; + if (fullname.toLowerCase().indexOf(object) > -1) { + var match = objects[prefix][name]; + var objname = objnames[match[1]][2]; + var title = titles[match[0]]; + // If more than one term searched for, we require other words to be + // found in the name/title/description + if (otherterms.length > 0) { + var haystack = (prefix + ' ' + name + ' ' + + objname + ' ' + title).toLowerCase(); + var allfound = true; + for (var i = 0; i < otherterms.length; i++) { + if (haystack.indexOf(otherterms[i]) == -1) { + allfound = false; + break; + } + } + if (!allfound) { + continue; + } + } + var descr = objname + _(', in ') + title; + anchor = match[3]; + if (anchor == '') + anchor = fullname; + else if (anchor == '-') + anchor = objnames[match[1]][1] + '-' + fullname; + result = [filenames[match[0]], fullname, '#'+anchor, descr]; + switch (match[2]) { + case 1: objectResults.push(result); break; + case 0: importantResults.push(result); break; + case 2: unimportantResults.push(result); break; + } + } + } + } + + // sort results descending + objectResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + importantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + unimportantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + return [importantResults, objectResults, unimportantResults] } } $(document).ready(function() { Search.init(); -}); +}); \ No newline at end of file diff --git a/postgresql/documentation/html/_static/sidebar.js b/postgresql/documentation/html/_static/sidebar.js index be206ede..a45e1926 100644 --- a/postgresql/documentation/html/_static/sidebar.js +++ b/postgresql/documentation/html/_static/sidebar.js @@ -16,7 +16,7 @@ * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,6 +29,9 @@ $(function() { var sidebar = $('.sphinxsidebar'); var sidebarwrapper = $('.sphinxsidebarwrapper'); + // for some reason, the document has no sidebar; do not run into errors + if (!sidebar.length) return; + // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded var bw_margin_expanded = bodywrapper.css('margin-left'); @@ -91,6 +94,7 @@ $(function() { '
    «
    ' ); var sidebarbutton = $('#sidebarbutton'); + light_color = sidebarbutton.css('background-color'); // find the height of the viewport to center the '<<' in the page var viewport_height; if (window.innerHeight) @@ -144,4 +148,4 @@ $(function() { add_sidebar_button(); var sidebarbutton = $('#sidebarbutton'); set_position_from_cookie(); -}); \ No newline at end of file +}); diff --git a/postgresql/documentation/html/_static/underscore.js b/postgresql/documentation/html/_static/underscore.js index 9146e086..5d899143 100644 --- a/postgresql/documentation/html/_static/underscore.js +++ b/postgresql/documentation/html/_static/underscore.js @@ -1,3 +1,10 @@ +// Underscore.js 0.5.5 +// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the terms of the MIT license. +// Portions of Underscore are inspired by or borrowed from Prototype.js, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore/ (function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e 0) { + var start = document.cookie.indexOf('sortBy='); + if (start != -1) { + start = start + 7; + var end = document.cookie.indexOf(";", start); + if (end == -1) { + end = document.cookie.length; + by = unescape(document.cookie.substring(start, end)); + } + } + } + setComparator(); + } + + /** + * Show a comment div. + */ + function show(id) { + $('#ao' + id).hide(); + $('#ah' + id).show(); + var context = $.extend({id: id}, opts); + var popup = $(renderTemplate(popupTemplate, context)).hide(); + popup.find('textarea[name="proposal"]').hide(); + popup.find('a.by' + by).addClass('sel'); + var form = popup.find('#cf' + id); + form.submit(function(event) { + event.preventDefault(); + addComment(form); + }); + $('#s' + id).after(popup); + popup.slideDown('fast', function() { + getComments(id); + }); + } + + /** + * Hide a comment div. + */ + function hide(id) { + $('#ah' + id).hide(); + $('#ao' + id).show(); + var div = $('#sc' + id); + div.slideUp('fast', function() { + div.remove(); + }); + } + + /** + * Perform an ajax request to get comments for a node + * and insert the comments into the comments tree. + */ + function getComments(id) { + $.ajax({ + type: 'GET', + url: opts.getCommentsURL, + data: {node: id}, + success: function(data, textStatus, request) { + var ul = $('#cl' + id); + var speed = 100; + $('#cf' + id) + .find('textarea[name="proposal"]') + .data('source', data.source); + + if (data.comments.length === 0) { + ul.html('
  • No comments yet.
  • '); + ul.data('empty', true); + } else { + // If there are comments, sort them and put them in the list. + var comments = sortComments(data.comments); + speed = data.comments.length * 100; + appendComments(comments, ul); + ul.data('empty', false); + } + $('#cn' + id).slideUp(speed + 200); + ul.slideDown(speed); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem retrieving the comments.'); + }, + dataType: 'json' + }); + } + + /** + * Add a comment via ajax and insert the comment into the comment tree. + */ + function addComment(form) { + var node_id = form.find('input[name="node"]').val(); + var parent_id = form.find('input[name="parent"]').val(); + var text = form.find('textarea[name="comment"]').val(); + var proposal = form.find('textarea[name="proposal"]').val(); + + if (text == '') { + showError('Please enter a comment.'); + return; + } + + // Disable the form that is being submitted. + form.find('textarea,input').attr('disabled', 'disabled'); + + // Send the comment to the server. + $.ajax({ + type: "POST", + url: opts.addCommentURL, + dataType: 'json', + data: { + node: node_id, + parent: parent_id, + text: text, + proposal: proposal + }, + success: function(data, textStatus, error) { + // Reset the form. + if (node_id) { + hideProposeChange(node_id); + } + form.find('textarea') + .val('') + .add(form.find('input')) + .removeAttr('disabled'); + var ul = $('#cl' + (node_id || parent_id)); + if (ul.data('empty')) { + $(ul).empty(); + ul.data('empty', false); + } + insertComment(data.comment); + var ao = $('#ao' + node_id); + ao.find('img').attr({'src': opts.commentBrightImage}); + if (node_id) { + // if this was a "root" comment, remove the commenting box + // (the user can get it back by reopening the comment popup) + $('#ca' + node_id).slideUp(); + } + }, + error: function(request, textStatus, error) { + form.find('textarea,input').removeAttr('disabled'); + showError('Oops, there was a problem adding the comment.'); + } + }); + } + + /** + * Recursively append comments to the main comment list and children + * lists, creating the comment tree. + */ + function appendComments(comments, ul) { + $.each(comments, function() { + var div = createCommentDiv(this); + ul.append($(document.createElement('li')).html(div)); + appendComments(this.children, div.find('ul.comment-children')); + // To avoid stagnating data, don't store the comments children in data. + this.children = null; + div.data('comment', this); + }); + } + + /** + * After adding a new comment, it must be inserted in the correct + * location in the comment tree. + */ + function insertComment(comment) { + var div = createCommentDiv(comment); + + // To avoid stagnating data, don't store the comments children in data. + comment.children = null; + div.data('comment', comment); + + var ul = $('#cl' + (comment.node || comment.parent)); + var siblings = getChildren(ul); + + var li = $(document.createElement('li')); + li.hide(); + + // Determine where in the parents children list to insert this comment. + for(i=0; i < siblings.length; i++) { + if (comp(comment, siblings[i]) <= 0) { + $('#cd' + siblings[i].id) + .parent() + .before(li.html(div)); + li.slideDown('fast'); + return; + } + } + + // If we get here, this comment rates lower than all the others, + // or it is the only comment in the list. + ul.append(li.html(div)); + li.slideDown('fast'); + } + + function acceptComment(id) { + $.ajax({ + type: 'POST', + url: opts.acceptCommentURL, + data: {id: id}, + success: function(data, textStatus, request) { + $('#cm' + id).fadeOut('fast'); + $('#cd' + id).removeClass('moderate'); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem accepting the comment.'); + } + }); + } + + function deleteComment(id) { + $.ajax({ + type: 'POST', + url: opts.deleteCommentURL, + data: {id: id}, + success: function(data, textStatus, request) { + var div = $('#cd' + id); + if (data == 'delete') { + // Moderator mode: remove the comment and all children immediately + div.slideUp('fast', function() { + div.remove(); + }); + return; + } + // User mode: only mark the comment as deleted + div + .find('span.user-id:first') + .text('[deleted]').end() + .find('div.comment-text:first') + .text('[deleted]').end() + .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + + ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) + .remove(); + var comment = div.data('comment'); + comment.username = '[deleted]'; + comment.text = '[deleted]'; + div.data('comment', comment); + }, + error: function(request, textStatus, error) { + showError('Oops, there was a problem deleting the comment.'); + } + }); + } + + function showProposal(id) { + $('#sp' + id).hide(); + $('#hp' + id).show(); + $('#pr' + id).slideDown('fast'); + } + + function hideProposal(id) { + $('#hp' + id).hide(); + $('#sp' + id).show(); + $('#pr' + id).slideUp('fast'); + } + + function showProposeChange(id) { + $('#pc' + id).hide(); + $('#hc' + id).show(); + var textarea = $('#pt' + id); + textarea.val(textarea.data('source')); + $.fn.autogrow.resize(textarea[0]); + textarea.slideDown('fast'); + } + + function hideProposeChange(id) { + $('#hc' + id).hide(); + $('#pc' + id).show(); + var textarea = $('#pt' + id); + textarea.val('').removeAttr('disabled'); + textarea.slideUp('fast'); + } + + function toggleCommentMarkupBox(id) { + $('#mb' + id).toggle(); + } + + /** Handle when the user clicks on a sort by link. */ + function handleReSort(link) { + var classes = link.attr('class').split(/\s+/); + for (var i=0; iThank you! Your comment will show up ' + + 'once it is has been approved by a moderator.'); + } + // Prettify the comment rating. + comment.pretty_rating = comment.rating + ' point' + + (comment.rating == 1 ? '' : 's'); + // Make a class (for displaying not yet moderated comments differently) + comment.css_class = comment.displayed ? '' : ' moderate'; + // Create a div for this comment. + var context = $.extend({}, opts, comment); + var div = $(renderTemplate(commentTemplate, context)); + + // If the user has voted on this comment, highlight the correct arrow. + if (comment.vote) { + var direction = (comment.vote == 1) ? 'u' : 'd'; + div.find('#' + direction + 'v' + comment.id).hide(); + div.find('#' + direction + 'u' + comment.id).show(); + } + + if (opts.moderator || comment.text != '[deleted]') { + div.find('a.reply').show(); + if (comment.proposal_diff) + div.find('#sp' + comment.id).show(); + if (opts.moderator && !comment.displayed) + div.find('#cm' + comment.id).show(); + if (opts.moderator || (opts.username == comment.username)) + div.find('#dc' + comment.id).show(); + } + return div; + } + + /** + * A simple template renderer. Placeholders such as <%id%> are replaced + * by context['id'] with items being escaped. Placeholders such as <#id#> + * are not escaped. + */ + function renderTemplate(template, context) { + var esc = $(document.createElement('div')); + + function handle(ph, escape) { + var cur = context; + $.each(ph.split('.'), function() { + cur = cur[this]; + }); + return escape ? esc.text(cur || "").html() : cur; + } + + return template.replace(/<([%#])([\w\.]*)\1>/g, function() { + return handle(arguments[2], arguments[1] == '%' ? true : false); + }); + } + + /** Flash an error message briefly. */ + function showError(message) { + $(document.createElement('div')).attr({'class': 'popup-error'}) + .append($(document.createElement('div')) + .attr({'class': 'error-message'}).text(message)) + .appendTo('body') + .fadeIn("slow") + .delay(2000) + .fadeOut("slow"); + } + + /** Add a link the user uses to open the comments popup. */ + $.fn.comment = function() { + return this.each(function() { + var id = $(this).attr('id').substring(1); + var count = COMMENT_METADATA[id]; + var title = count + ' comment' + (count == 1 ? '' : 's'); + var image = count > 0 ? opts.commentBrightImage : opts.commentImage; + var addcls = count == 0 ? ' nocomment' : ''; + $(this) + .append( + $(document.createElement('a')).attr({ + href: '#', + 'class': 'sphinx-comment-open' + addcls, + id: 'ao' + id + }) + .append($(document.createElement('img')).attr({ + src: image, + alt: 'comment', + title: title + })) + .click(function(event) { + event.preventDefault(); + show($(this).attr('id').substring(2)); + }) + ) + .append( + $(document.createElement('a')).attr({ + href: '#', + 'class': 'sphinx-comment-close hidden', + id: 'ah' + id + }) + .append($(document.createElement('img')).attr({ + src: opts.closeCommentImage, + alt: 'close', + title: 'close' + })) + .click(function(event) { + event.preventDefault(); + hide($(this).attr('id').substring(2)); + }) + ); + }); + }; + + var opts = { + processVoteURL: '/_process_vote', + addCommentURL: '/_add_comment', + getCommentsURL: '/_get_comments', + acceptCommentURL: '/_accept_comment', + deleteCommentURL: '/_delete_comment', + commentImage: '/static/_static/comment.png', + closeCommentImage: '/static/_static/comment-close.png', + loadingImage: '/static/_static/ajax-loader.gif', + commentBrightImage: '/static/_static/comment-bright.png', + upArrow: '/static/_static/up.png', + downArrow: '/static/_static/down.png', + upArrowPressed: '/static/_static/up-pressed.png', + downArrowPressed: '/static/_static/down-pressed.png', + voting: false, + moderator: false + }; + + if (typeof COMMENT_OPTIONS != "undefined") { + opts = jQuery.extend(opts, COMMENT_OPTIONS); + } + + var popupTemplate = '\ +
    \ +

    \ + Sort by:\ + best rated\ + newest\ + oldest\ +

    \ +
    Comments
    \ +
    \ + loading comments...
    \ +
      \ +
      \ +

      Add a comment\ + (markup):

      \ +
      \ + reStructured text markup: *emph*, **strong**, \ + ``code``, \ + code blocks: :: and an indented block after blank line
      \ +
      \ + \ +

      \ + \ + Propose a change ▹\ + \ + \ + Propose a change ▿\ + \ +

      \ + \ + \ + \ + \ +
      \ +
      \ +
      '; + + var commentTemplate = '\ +
      \ +
      \ +
      \ + \ + \ + \ + \ + \ + \ +
      \ +
      \ + \ + \ + \ + \ + \ + \ +
      \ +
      \ +
      \ +

      \ + <%username%>\ + <%pretty_rating%>\ + <%time.delta%>\ +

      \ +
      <#text#>
      \ +

      \ + \ + reply ▿\ + proposal ▹\ + proposal ▿\ + \ + \ +

      \ +
      \
      +<#proposal_diff#>\
      +        
      \ +
        \ +
        \ +
        \ +
        \ + '; + + var replyTemplate = '\ +
      • \ +
        \ +
        \ + \ + \ + \ + \ + \ +
        \ +
        \ +
      • '; + + $(document).ready(function() { + init(); + }); +})(jQuery); + +$(document).ready(function() { + // add comment anchors for all paragraphs that are commentable + $('.sphinx-has-comment').comment(); + + // highlight search words in search results + $("div.context").each(function() { + var params = $.getQueryParameters(); + var terms = (params.q) ? params.q[0].split(/\s+/) : []; + var result = $(this); + $.each(terms, function() { + result.highlightText(this.toLowerCase(), 'highlighted'); + }); + }); + + // directly open comment window if requested + var anchor = document.location.hash; + if (anchor.substring(0, 9) == '#comment-') { + $('#ao' + anchor.substring(9)).click(); + document.location.hash = '#s' + anchor.substring(9); + } +}); diff --git a/postgresql/documentation/html/admin.html b/postgresql/documentation/html/admin.html index c1771ebc..86e4f658 100644 --- a/postgresql/documentation/html/admin.html +++ b/postgresql/documentation/html/admin.html @@ -3,17 +3,20 @@ + - Administration — py-postgresql v1.0.2 documentation + Administration — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -71,18 +77,18 @@

        InstallationΒΆ

        These environment variables effect the operation of the package:

        - +
        - +
        PGINSTALLATION
        PGINSTALLATION The path to the pg_config executable of the installation to use by default.
        -
        + @@ -115,7 +121,7 @@

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/alock.html b/postgresql/documentation/html/alock.html index 3feed2d9..5a542bdf 100644 --- a/postgresql/documentation/html/alock.html +++ b/postgresql/documentation/html/alock.html @@ -3,17 +3,20 @@ + - Advisory Locks — py-postgresql v1.0.2 documentation + Advisory Locks — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -60,16 +66,16 @@

        Navigation

        using table locks may cause interference with other operations that can be safely performed alongside the application-level, exclusive operation.

        Advisory locks can be used by directly executing the stored procedures in the -database or by using the postgresql.alock.ALock subclasses, which +database or by using the postgresql.alock.ALock subclasses, which provides a context manager that uses those stored procedures.

        Currently, only two subclasses exist. Each represents the lock mode supported by PostgreSQL’s advisory locks:

        -
          +
          • postgresql.alock.ShareLock
          • postgresql.alock.ExclusiveLock
          -
        +

        Acquiring ALocksΒΆ

        An ALock instance represents a sequence of advisory locks. A single ALock can @@ -84,7 +90,7 @@

        Acquiring ALocks>>> l.release()

        -

        postgresql.alock.ALock is similar to threading.RLock; in +

        postgresql.alock.ALock is similar to threading.RLock; in order for an ALock to be released, it must be released the number of times it has been acquired. ALocks are associated with and survived by their session. Much like how RLocks are associated with the thread they are acquired in: @@ -108,7 +114,7 @@

        ALocks +
        postgresql.alock.ExclusiveLock(database, *identifiers)
        Instantiate an ALock object representing the identifiers for use with the database. Exclusive locks will conflict with other exclusive locks and share @@ -119,12 +125,12 @@

        ALocks

        ALock Interface PointsΒΆ

        -

        Methods and properties available on postgresql.alock.ALock instances:

        +

        Methods and properties available on postgresql.alock.ALock instances:

        -
        +
        alock.acquire(blocking = True)

        Acquire the advisory locks represented by the alock object. If blocking is True, the default, the method will block until locks on all the @@ -144,7 +150,7 @@

        ALock Interface Pointsalock.__exit__(typ, val, tb)
        Alias to release; context manager protocol.

        -
        +

        @@ -181,7 +187,7 @@

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/bin.html b/postgresql/documentation/html/bin.html index 4bf5c4f9..02cf0798 100644 --- a/postgresql/documentation/html/bin.html +++ b/postgresql/documentation/html/bin.html @@ -3,17 +3,20 @@ + - Commands — py-postgresql v1.0.2 documentation + Commands — py-postgresql 1.0.4 documentation + + - - + + + @@ -55,7 +65,7 @@

        postgresql.bin.pg_python +

        pg_python UsageΒΆ

        Usage: postgresql.bin.pg_python [connection options] [script] ...

        @@ -151,7 +161,7 @@

        Interactive Console Backslash Commands

        pg_python ExamplesΒΆ

        Module execution taking advantage of the new built-ins:

        -
        $ python3 -m postgresql.bin.pg_python -h localhost -W -m timeit "prepare('SELECT 1').first()"
        +
        $ python3 -m postgresql.bin.pg_python -h localhost -W -m timeit "prepare('SELECT 1').first()"
         Password for pg_python[pq://jwp@localhost:5432]:
         1000 loops, best of 3: 1.35 msec per loop
         
        -$ python3 -m postgresql.bin.pg_python -h localhost -W -m timeit -s "ps=prepare('SELECT 1')" "ps.first()"
        +$ python3 -m postgresql.bin.pg_python -h localhost -W -m timeit -s "ps=prepare('SELECT 1')" "ps.first()"
         Password for pg_python[pq://jwp@localhost:5432]:
         1000 loops, best of 3: 442 usec per loop

        Simple interactive usage:

        $ python3 -m postgresql.bin.pg_python -h localhost -W
         Password for pg_python[pq://jwp@localhost:5432]:
        ->>> ps = prepare('select 1')
        +>>> ps = prepare('select 1')
         >>> ps.first()
         1
         >>> c = ps()
        @@ -225,32 +235,32 @@ 

        pg_dotconf Usage

        ExamplesΒΆ

        Modifying a simple configuration file:

        -
        $ echo "setting = value" >pg.conf
        +
        $ echo "setting = value" >pg.conf
         
        -# change 'setting'
        +# change 'setting'
         $ python3 -m postgresql.bin.pg_dotconf pg.conf setting=newvalue
         
         $ cat pg.conf
        -setting = 'newvalue'
        +setting = 'newvalue'
         
         # new settings are appended to the file
         $ python3 -m postgresql.bin.pg_dotconf pg.conf another_setting=value
         $ cat pg.conf
        -setting = 'newvalue'
        -another_setting = 'value'
        +setting = 'newvalue'
        +another_setting = 'value'
         
         # comment a setting
         $ python3 -m postgresql.bin.pg_dotconf pg.conf another_setting
         
         $ cat pg.conf
        -setting = 'newvalue'
        -#another_setting = 'value'
        +setting = 'newvalue' +#another_setting = 'value'

        When a setting is given on the command line, it must been seen as one argument to the command, so it’s very important to avoid invocations like:

        $ python3 -m postgresql.bin.pg_dotconf pg.conf setting = value
        -ERROR: invalid setting, '=' after 'setting'
        -HINT: Settings must take the form 'setting=value' or 'setting_name_to_comment'. Settings must also be received as a single argument.
        +ERROR: invalid setting, '=' after 'setting' +HINT: Settings must take the form 'setting=value' or 'setting_name_to_comment'. Settings must also be received as a single argument.

        @@ -281,8 +291,11 @@

        Table Of Contents

        Previous topic

        -

        Changes

        +

        Gotchas

        +

        Next topic

        +

        Modules

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/changes.html b/postgresql/documentation/html/changes-v1.0.html similarity index 70% rename from postgresql/documentation/html/changes.html rename to postgresql/documentation/html/changes-v1.0.html index ce0ca938..e3a09a69 100644 --- a/postgresql/documentation/html/changes.html +++ b/postgresql/documentation/html/changes-v1.0.html @@ -3,17 +3,20 @@ + - Changes — py-postgresql v1.0.2 documentation + Changes in v1.0 — py-postgresql 1.0.4 documentation + + - - - + + @@ -48,12 +50,37 @@

        Navigation

        -
        -

        ChangesΒΆ

        +
        +

        Changes in v1.0ΒΆ

        +
        +

        1.0.4 in developmentΒΆ

        +
        +
          +
        • Fix usage of weakrefs for statement/cursor GC. (Elvis Pranskevichus) +(Fixes mysterious DuplicateCursorError exceptions)
        • +
        • Add support for binary inet/cidr/macaddr types for use with arrays and composites. (Matthew Grant & Barry Grussling)
        • +
        • Add support for (un)pickling postgresql.types.Array objects. (Elvis Pranskevichus)
        • +
        • Alter how changes are represented in documentation to simplify merging.
        • +
        +
        +
        +
        +

        1.0.3 released on 2011-09-24ΒΆ

        +
        +
          +
        • Use raise x from y to generalize exceptions. (Elvis Pranskevichus)
        • +
        • Alter postgresql.string.quote_ident to always quote. (Elvis Pranskevichus)
        • +
        • Add postgresql.string.quote_ident_if_necessary (Modification of Elvis Pranskevichus’ patch)
        • +
        • Many postgresql.string bug fixes (Elvis Pranskevichus)
        • +
        • Correct ResourceWarnings improving Python 3.2 support. (jwp)
        • +
        • Add test command to setup.py (Elvis Pranskevichus)
        • +
        +
        +

        1.0.2 released on 2010-09-18ΒΆ

        -
          +
          • Add support for DOMAINs in registered composites. (Elvis Pranskevichus)
          • Properly raise StopIteration in Cursor.__next__. (Elvis Pranskevichus)
          • Add Cluster Management documentation.
          • @@ -62,24 +89,24 @@

            1.0.2 released on 2010-09-18

            1.0.1 released on 2010-04-24ΒΆ

            -
              +
              • Fix unpacking of array NULLs. (Elvis Pranskevichus)
              • Fix .first()’s handling of counts and commands. Bad logic caused zero-counts to return the command tag.
              • Don’t interrupt and close a temporal connection if it’s not open.
              • Use the Driver’s typio attribute for TypeIO overrides. (Elvis Pranskevichus)
              -
            +

        1.0 released on 2010-03-27ΒΆ

        -
        @@ -88,11 +94,11 @@

        Collecting ParametersThe postgresql.clientparameters module is executable, so you can see the results of the above snippet by:

        $ python -m postgresql.clientparameters -h localhost -U a_db_user -ssearch_path=public
        -{'host': 'localhost',
        - 'password': None,
        - 'port': 5432,
        - 'settings': {'search_path': 'public'},
        - 'user': 'a_db_user'}
        +{'host': 'localhost', + 'password': None, + 'port': 5432, + 'settings': {'search_path': 'public'}, + 'user': 'a_db_user'}

        If prompt_title is not set to None, it will prompt for the password when instructed to do by the prompt_password key in the parameters:

        When resolution occurs, the prompt_password, prompt_title, and pgpassfile keys are removed from the given parameters dictionary:

        [PGDATA] referenced in the above table is a directory whose path is platform dependent. On most systems, it is "$HOME/.postgresql", but on Windows based systems it is "%APPDATA%\postgresql"

        @@ -266,65 +272,65 @@

        Defaultsenviron_prefix and the keyword that it will be mapped to:

        - +
        - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        Environment Variable
        Environment Variable Keyword
        PGUSER
        PGUSER 'user'
        PGDATABASE
        PGDATABASE 'database'
        PGHOST
        PGHOST 'host'
        PGPORT
        PGPORT 'port'
        PGPASSWORD
        PGPASSWORD 'password'
        PGSSLMODE
        PGSSLMODE 'sslmode'
        PGSSLKEY
        PGSSLKEY 'sslkey'
        PGCONNECT_TIMEOUT
        PGCONNECT_TIMEOUT 'connect_timeout'
        PGREALM
        PGREALM 'kerberos4_realm'
        PGKRBSRVNAME
        PGKRBSRVNAME 'kerberos5_service'
        PGPASSFILE
        PGPASSFILE 'pgpassfile'
        PGTZ
        PGTZ 'settings' = {'timezone': }
        PGDATESTYLE
        PGDATESTYLE 'settings' = {'datestyle': }
        PGCLIENTENCODING
        PGCLIENTENCODING 'settings' = {'client_encoding': }
        PGGEQO
        PGGEQO 'settings' = {'geqo': }
        -
        +

        PostgreSQL Password FileΒΆ

        @@ -387,7 +393,7 @@

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/cluster.html b/postgresql/documentation/html/cluster.html index 052f3a15..92013e7a 100644 --- a/postgresql/documentation/html/cluster.html +++ b/postgresql/documentation/html/cluster.html @@ -3,17 +3,20 @@ + - Cluster Management — py-postgresql v1.0.2 documentation + Cluster Management — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -70,7 +76,7 @@

        Navigation

        Installation Interface PointsΒΆ

        -
        +
        Installation(info)

        Instantiate an Installation using the given information. Normally, this information is extracted from a pg_config executable using @@ -142,7 +148,7 @@

        Installation Interface Points @@ -249,7 +255,7 @@

        Controlling ClustersCluster Interface PointsΒΆ

        Methods and properties available on postgresql.cluster.Cluster instances:

        -
        +
        Cluster(installation, data_directory)

        Create a postgresql.cluster.Cluster object for the specified postgresql.installation.Installation, and data_directory.

        @@ -375,7 +381,7 @@

        Cluster Interface Points
      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • \ No newline at end of file diff --git a/postgresql/documentation/html/copyman.html b/postgresql/documentation/html/copyman.html index c735460b..0e045de3 100644 --- a/postgresql/documentation/html/copyman.html +++ b/postgresql/documentation/html/copyman.html @@ -3,17 +3,20 @@ + - Copy Management — py-postgresql v1.0.2 documentation + Copy Management — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -50,10 +56,6 @@

        Navigation

        Copy ManagementΒΆ

        -
        -

        Warning

        -

        postgresql.copyman is a new feature in v1.0.

        -

        The postgresql.copyman module provides a way to quickly move COPY data coming from one connection to many connections. Alternatively, it can be sourced by arbitrary iterators and target arbitrary callables.

        @@ -112,7 +114,7 @@

        Manager Interface Points +

        +
        @@ -193,13 +195,13 @@

        Receiver FaultsΒΆ

        The following attributes exist on postgresql.copyman.ReceiverFault instances:

        -
        +
        ReceiverFault.manager
        The subject postgresql.copyman.CopyManager instance.
        ReceiverFault.faults
        A dictionary mapping the Receiver to the exception raised by that Receiver.
        -
        +

        ReconciliationΒΆ

        @@ -247,13 +249,13 @@

        Producer FaultsΒΆ

        The following attributes exist on postgresql.copyman.ProducerFault instances:

        -
        +
        ReceiverFault.manager
        The subject postgresql.copyman.CopyManager.
        ReceiverFault.__context__
        The original exception raised by the Producer.
        -
        +
        @@ -268,7 +270,7 @@

        FailuresΒΆ

        The following properties exist on postgresql.copyman.CopyFail exceptions:

        -
        +
        CopyFail.manager
        The Manager whose COPY operation failed.
        CopyFail.receiver_faults
        @@ -278,26 +280,26 @@

        CopyFail PropertiesCopyFail.producer_fault
        The exception Raised by the postgresql.copyman.Producer. None if none.

        -
        +

        ProducersΒΆ

        The following Producers are available:

        -
        +
        postgresql.copyman.StatementProducer(postgresql.api.Statement)
        Given a Statement producing COPY data, construct a Producer.
        postgresql.copyman.IteratorProducer(collections.Iterator)
        Given an Iterator producing chunks of COPY lines, construct a Producer to manage the data coming from the iterator.
        -
        +

        ReceiversΒΆ

        -
        +
        postgresql.copyman.StatementReceiver(postgresql.api.Statement)
        Given a Statement producing COPY data, construct a Producer.
        postgresql.copyman.CallReceiver(callable)
        @@ -305,14 +307,14 @@

        Receivers

        TerminologyΒΆ

        The following terms are regularly used to describe the implementation and processes of the postgresql.copyman module:

        -
        +
        Manager
        The object used to manage data coming from a Producer and being given to the Receivers. It also manages the necessary initialization and finalization steps @@ -340,7 +342,7 @@

        Terminology
      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • \ No newline at end of file diff --git a/postgresql/documentation/html/doctrees/admin.doctree b/postgresql/documentation/html/doctrees/admin.doctree index 21813ed4..35d94de2 100644 Binary files a/postgresql/documentation/html/doctrees/admin.doctree and b/postgresql/documentation/html/doctrees/admin.doctree differ diff --git a/postgresql/documentation/html/doctrees/alock.doctree b/postgresql/documentation/html/doctrees/alock.doctree index 48d3c74a..4bac8f3e 100644 Binary files a/postgresql/documentation/html/doctrees/alock.doctree and b/postgresql/documentation/html/doctrees/alock.doctree differ diff --git a/postgresql/documentation/html/doctrees/bin.doctree b/postgresql/documentation/html/doctrees/bin.doctree index 15838a6f..93394a47 100644 Binary files a/postgresql/documentation/html/doctrees/bin.doctree and b/postgresql/documentation/html/doctrees/bin.doctree differ diff --git a/postgresql/documentation/html/doctrees/changes-v1.0.doctree b/postgresql/documentation/html/doctrees/changes-v1.0.doctree new file mode 100644 index 00000000..93cc140f Binary files /dev/null and b/postgresql/documentation/html/doctrees/changes-v1.0.doctree differ diff --git a/postgresql/documentation/html/doctrees/changes.doctree b/postgresql/documentation/html/doctrees/changes.doctree deleted file mode 100644 index 97c278c7..00000000 Binary files a/postgresql/documentation/html/doctrees/changes.doctree and /dev/null differ diff --git a/postgresql/documentation/html/doctrees/clientparameters.doctree b/postgresql/documentation/html/doctrees/clientparameters.doctree index ad46cbfd..02722f89 100644 Binary files a/postgresql/documentation/html/doctrees/clientparameters.doctree and b/postgresql/documentation/html/doctrees/clientparameters.doctree differ diff --git a/postgresql/documentation/html/doctrees/cluster.doctree b/postgresql/documentation/html/doctrees/cluster.doctree index 3db74db5..fb6c74db 100644 Binary files a/postgresql/documentation/html/doctrees/cluster.doctree and b/postgresql/documentation/html/doctrees/cluster.doctree differ diff --git a/postgresql/documentation/html/doctrees/copyman.doctree b/postgresql/documentation/html/doctrees/copyman.doctree index 6b5fec23..1cc4a3e6 100644 Binary files a/postgresql/documentation/html/doctrees/copyman.doctree and b/postgresql/documentation/html/doctrees/copyman.doctree differ diff --git a/postgresql/documentation/html/doctrees/driver.doctree b/postgresql/documentation/html/doctrees/driver.doctree index 4de785ef..2ba24ebc 100644 Binary files a/postgresql/documentation/html/doctrees/driver.doctree and b/postgresql/documentation/html/doctrees/driver.doctree differ diff --git a/postgresql/documentation/html/doctrees/environment.pickle b/postgresql/documentation/html/doctrees/environment.pickle index 73034a69..8595f899 100644 Binary files a/postgresql/documentation/html/doctrees/environment.pickle and b/postgresql/documentation/html/doctrees/environment.pickle differ diff --git a/postgresql/documentation/html/doctrees/gotchas.doctree b/postgresql/documentation/html/doctrees/gotchas.doctree index 6a795a01..520cc5c4 100644 Binary files a/postgresql/documentation/html/doctrees/gotchas.doctree and b/postgresql/documentation/html/doctrees/gotchas.doctree differ diff --git a/postgresql/documentation/html/doctrees/index.doctree b/postgresql/documentation/html/doctrees/index.doctree index 33a39e44..55fc3370 100644 Binary files a/postgresql/documentation/html/doctrees/index.doctree and b/postgresql/documentation/html/doctrees/index.doctree differ diff --git a/postgresql/documentation/html/doctrees/lib.doctree b/postgresql/documentation/html/doctrees/lib.doctree index 2debc3e5..6fe224a9 100644 Binary files a/postgresql/documentation/html/doctrees/lib.doctree and b/postgresql/documentation/html/doctrees/lib.doctree differ diff --git a/postgresql/documentation/html/doctrees/modules.doctree b/postgresql/documentation/html/doctrees/modules.doctree new file mode 100644 index 00000000..999d4478 Binary files /dev/null and b/postgresql/documentation/html/doctrees/modules.doctree differ diff --git a/postgresql/documentation/html/doctrees/notifyman.doctree b/postgresql/documentation/html/doctrees/notifyman.doctree index 59bf1fc4..a17fcaef 100644 Binary files a/postgresql/documentation/html/doctrees/notifyman.doctree and b/postgresql/documentation/html/doctrees/notifyman.doctree differ diff --git a/postgresql/documentation/html/driver.html b/postgresql/documentation/html/driver.html index d7c1545b..5c5f7b2e 100644 --- a/postgresql/documentation/html/driver.html +++ b/postgresql/documentation/html/driver.html @@ -3,17 +3,20 @@ + - Driver — py-postgresql v1.0.2 documentation + Driver — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -73,18 +79,18 @@

        Navigation

        The following identifiers are regularly used as shorthands for significant interface elements:

        -
        +
        db
        -
        postgresql.api.Connection, a database connection. Connections
        +
        postgresql.api.Connection, a database connection. Connections
        ps
        -
        postgresql.api.Statement, a prepared statement. Prepared Statements
        +
        postgresql.api.Statement, a prepared statement. Prepared Statements
        c
        postgresql.api.Cursor, a cursor; the results of a prepared statement. -Cursors
        +Cursors
        C
        -
        postgresql.api.Connector, a connector. Connectors
        +
        postgresql.api.Connector, a connector. Connectors
        -
        +

        Establishing a ConnectionΒΆ

        There are many ways to establish a postgresql.api.Connection to a @@ -146,7 +152,7 @@

        postgresql.open

        For a complete list of keywords that postgresql.open can accept, see -Connection Keywords. +Connection Keywords. For more information about the environment variables, see PostgreSQL Environment Variables. For more information about the pgpassfile, see PostgreSQL Password File.

        @@ -173,7 +179,7 @@

        postgresql.driver.connectNote

        connect will not inherit parameters from the environment as libpq-based drivers do.

        -

        See Connection Keywords for a full list of acceptable keyword parameters and +

        See Connection Keywords for a full list of acceptable keyword parameters and their meaning.

        @@ -190,7 +196,7 @@

        ConnectorsConnection Keywords, so that list can be +connection parameters described in Connection Keywords, so that list can be used as a reference to identify the information available on the connector.

        Connectors fit into the category of “connection creation interfaces”, so connector instantiation normally takes the same parameters that the @@ -203,7 +209,7 @@

        Connectors +

        host is the usual connector used to establish a connection:

        >>> C = postgresql.driver.default.host(
         ...  user = 'auser',
        @@ -253,7 +259,7 @@ 

        Connection Keywords +
        user
        The user to connect as.
        password
        @@ -304,7 +310,7 @@

        Connection Keywords @@ -330,24 +336,24 @@

        Database Interface Points +
        Connection.prepare(sql_statement_string)
        Create a postgresql.api.Statement object for querying the database. This provides an “SQL statement template” that can be executed multiple times. -See Prepared Statements for more information.
        +See Prepared Statements for more information.
        Connection.proc(procedure_id)
        Create a postgresql.api.StoredProcedure object referring to a stored procedure on the database. The returned object will provide a collections.Callable interface to the stored procedure on the server. See -Stored Procedures for more information.
        +Stored Procedures for more information.
        Connection.statement_from_id(statement_id)
        Create a postgresql.api.Statement object from an existing statement identifier. This is used in cases where the statement was prepared on the -server. See Prepared Statements for more information.
        +server. See Prepared Statements for more information.
        Connection.cursor_from_id(cursor_id)
        Create a postgresql.api.Cursor object from an existing cursor identifier. This is used in cases where the cursor was declared on the server. See -Cursors for more information.
        +Cursors for more information.
        Connection.do(language, source)
        Execute a DO statement on the server using the specified language. DO statements are available on PostgreSQL 9.0 and greater. @@ -360,11 +366,11 @@

        Database Interface PointsConnection.xact(isolation = None, mode = None)
        The postgresql.api.Transaction constructor for creating transactions. This method creates a transaction reference. The transaction will not be -started until it’s instructed to do so. See Transactions for more +started until it’s instructed to do so. See Transactions for more information.
        Connection.settings
        A property providing a collections.MutableMapping interface to the -database’s SQL settings. See Settings for more information.
        +database’s SQL settings. See Settings for more information.

        Connection.clone()
        Create a new connection object based on the same factors that were used to create db. The new connection returned will already be connected.
        @@ -372,7 +378,7 @@

        Database Interface PointsDatabase Messages section for more information. +Database Messages section for more information.
        Connection.listen(*channels)
        Start listening for asynchronous notifications in the specified channels. Sends a batch of LISTEN statements to the server.
        @@ -414,12 +420,12 @@

        Database Interface PointsNotification Management for details.

        - +

        When a connection is established, certain pieces of information are collected from the backend. The following are the attributes set on the connection object after the connection is made:

        -
        +
        Connection.version
        The version string of the server; the result of SELECT version().
        Connection.version_info
        @@ -440,7 +446,7 @@

        Database Interface Pointsfileno. Under normal circumstances, it will return an int.

        -
        +

        The backend_start, client_address, and client_port are collected from pg_stat_activity. If this information is unavailable, the attributes will be None.

        @@ -490,7 +496,7 @@

        Statement Interface Points +

        In order to provide the appropriate type transformations, the driver must acquire metadata about the statement’s parameters and results. This data is published via the following properties on the statement object:

        -
        +
        Statement.sql_parameter_types
        A sequence of SQL type names specifying the types of the parameters used in the statement.
        @@ -607,7 +613,7 @@

        Statement Interface Pointssql_parameter_types[0] -> '$1'.

        >>> ps = db.prepare("SELECT $1::integer AS intname, $2::varchar AS chardata")
        @@ -655,7 +661,7 @@ 

        Parameterized StatementsType Support.

        +in Type Support.

        This usage of types is not always convenient. Notably, the datetime module does not provide a friendly way for a user to express intervals, dates, or times. There is a likely inclination to forego these parameter type @@ -852,7 +858,7 @@

        Cursor Interface PointsFor cursors that return row data, these interfaces are provided for accessing those results:

        -
        +
        Cursor.read(quantity = None, direction = None)

        This method name is borrowed from file objects, and are semantically similar. However, this being a cursor, rows are returned instead of bytes or @@ -865,7 +871,7 @@

        Cursor Interface Points
        Cursor.seek(position[, whence = 0])
        When the cursor is scrollable, this seek interface can be used to move the -position of the cursor. See Scrollable Cursors for more information.
        +position of the cursor. See Scrollable Cursors for more information.

        next(Cursor)
        This fetches the next row in the cursor object. Cursors support the iterator protocol. While equivalent to cursor.read(1)[0], StopIteration is raised @@ -881,26 +887,26 @@

        Cursor Interface PointsCursor.msghook(msg)
        By default, the msghook attribute does not exist. If set to a callable, any message that occurs during an operation of the cursor will be given to the -callable. See the Database Messages section for more information.
        +callable. See the Database Messages section for more information.

        -
        +

        Cursors have some additional configuration properties that may be modified during the use of the cursor:

        -
        +
        Cursor.direction
        A value of True, the default, will cause read to fetch forwards, whereas a value of False will cause it to fetch backwards. 'BACKWARD' and 'FORWARD' can be used instead of False and True.
        -
        +

        Cursors normally share metadata with the statements that create them, so it is usually unnecessary for referencing the cursor’s column descriptions directly. However, when a cursor is opened from an identifier, the cursor interface must collect the metadata itself. These attributes provide the metadata in absence of a statement object:

        -
        +
        Cursor.sql_column_types
        A sequence of SQL type names specifying the types of the columns produced by the cursor. None if the cursor does not return row-data.
        @@ -916,7 +922,7 @@

        Cursor Interface PointsThe statement that was executed that created the cursor. None if unknown–db.cursor_from_id().

        -
        +

        - +

        The whence keyword argument allows for either numeric and textual specifications.

        Scrolling through employees:

        @@ -1039,7 +1045,7 @@

        RowsΒΆ

        Row Interface PointsΒΆ

        Rows implement the collections.Mapping and collections.Sequence interfaces.

        -
        +
        +

        While the mapping interfaces will provide most of the needed information, some additional properties are provided for consistency with statement and cursor objects.

        -
        +
        +

        Row TransformationsΒΆ

        @@ -1171,7 +1177,7 @@

        Stored ProceduresΒΆ

        It’s more-or-less a function, so there’s only one interface point:

        -
        +

        The specification of any of these transaction properties imply that the transaction is a block. Savepoints do not take configuration, so if a transaction identified as a block is started while another block is running, an exception will be @@ -1305,7 +1311,7 @@

        Transaction Interface Points @@ -1394,7 +1400,7 @@

        Settings Interface Points +
        Connection.settings[k]
        Get the value of a single setting.
        Connection.settings[k] = v
        @@ -1414,7 +1420,7 @@

        Settings Interface Points

        Settings ManagementΒΆ

        @@ -1457,81 +1463,81 @@

        Type Support -PostgreSQL Types +PostgreSQL Types Python Types SQL Types -postgresql.types.INT2OID +postgresql.types.INT2OID int smallint -postgresql.types.INT4OID +postgresql.types.INT4OID int integer -postgresql.types.INT8OID +postgresql.types.INT8OID int bigint -postgresql.types.FLOAT4OID +postgresql.types.FLOAT4OID float float -postgresql.types.FLOAT8OID +postgresql.types.FLOAT8OID float double -postgresql.types.VARCHAROID +postgresql.types.VARCHAROID str varchar -postgresql.types.BPCHAROID +postgresql.types.BPCHAROID str char -postgresql.types.XMLOID +postgresql.types.XMLOID xml.etree (cElementTree) xml -postgresql.types.DATEOID +postgresql.types.DATEOID datetime.date date -postgresql.types.TIMESTAMPOID +postgresql.types.TIMESTAMPOID datetime.datetime timestamp -postgresql.types.TIMESTAMPTZOID +postgresql.types.TIMESTAMPTZOID datetime.datetime (tzinfo) timestamptz -postgresql.types.TIMEOID +postgresql.types.TIMEOID datetime.time time -postgresql.types.TIMETZOID +postgresql.types.TIMETZOID datetime.time timetz -postgresql.types.INTERVALOID +postgresql.types.INTERVALOID datetime.timedelta interval -postgresql.types.NUMERICOID +postgresql.types.NUMERICOID decimal.Decimal numeric -postgresql.types.BYTEAOID +postgresql.types.BYTEAOID bytes bytea -postgresql.types.TEXTOID +postgresql.types.TEXTOID str text -<contrib_hstore> +<contrib_hstore> dict hstore @@ -1683,7 +1689,7 @@

        Message Metadata +
        Message.message
        The primary message string.
        Message.code
        @@ -1697,7 +1703,7 @@

        Message MetadataA mapping providing extended information about a message. This mapping object can contain the following keys:

        -
        + \ No newline at end of file diff --git a/postgresql/documentation/html/genindex.html b/postgresql/documentation/html/genindex.html index 7296a46b..b6dd9fe1 100644 --- a/postgresql/documentation/html/genindex.html +++ b/postgresql/documentation/html/genindex.html @@ -1,19 +1,24 @@ + + + - Index — py-postgresql v1.0.2 documentation + Index — py-postgresql 1.0.4 documentation + + - + @@ -41,11 +49,1136 @@

        Navigation

        -

        Index

        +

        Index

        + +
        + A + | B + | C + | D + | E + | F + | G + | H + | I + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | X + +
        +

        A

        + + + +
        + +
        abort() (postgresql.api.Transaction method) +
        + + +
        acquire() (postgresql.alock.ALock method) +
        + + +
        address() (postgresql.cluster.Cluster method) +
        + +
        + +
        ALock (class in postgresql.alock) +
        + + +
        AuthenticationMethodError +
        + +
        + +

        B

        + + + +
        + +
        backend_id (postgresql.api.Database attribute) +
        + +
        + +
        begin() (postgresql.api.Transaction method) +
        + +
        + +

        C

        + + + +
        + +
        CallReceiver (class in postgresql.copyman) +
        + + +
        CardinalityError +
        + + +
        Category (class in postgresql.api) +
        + + +
        CFError +
        + + +
        chunks() (postgresql.api.Statement method) +
        + + +
        client_address (postgresql.api.Database attribute) +
        + + +
        client_port (postgresql.api.Database attribute) +
        + + +
        ClientCannotConnectError +
        + + +
        clone() (postgresql.api.Connection method) +
        + +
        + +
        (postgresql.api.Cursor method) +
        + + +
        (postgresql.api.Statement method) +
        + +
        + +
        close() (postgresql.api.Connection method) +
        + +
        + +
        (postgresql.api.Statement method) +
        + +
        + +
        closed (postgresql.api.Connection attribute) +
        + + +
        Cluster (class in postgresql.api) +
        + +
        + +
        (class in postgresql.cluster) +
        + +
        + +
        cluster_dirname() (postgresql.temporal.Temporal method) +
        + + +
        ClusterError +
        + + +
        ClusterInitializationError +
        + + +
        ClusterNotRunningError +
        + + +
        ClusterStartupError +
        + + +
        ClusterTimeoutError +
        + + +
        ClusterWarning (class in postgresql.cluster) +
        + +
        + +
        code (postgresql.api.Message attribute) +
        + + +
        column() (postgresql.api.Statement method) +
        + + +
        column_names (postgresql.api.Statement attribute) +
        + + +
        column_types (postgresql.api.Statement attribute) +
        + + +
        commit() (postgresql.api.Transaction method) +
        + + +
        connect() (postgresql.api.Connection method) +
        + +
        + +
        (postgresql.api.Driver method) +
        + + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        Connection (class in postgresql.api) +
        + + +
        connection() (postgresql.cluster.Cluster method) +
        + + +
        ConnectionDoesNotExistError +
        + + +
        ConnectionFailureError +
        + + +
        Connector (class in postgresql.api) +
        + + +
        connector (postgresql.api.Connection attribute) +
        + + +
        connector() (postgresql.cluster.Cluster method) +
        + + +
        ConnectTimeoutError +
        + + +
        CopyFail +
        + + +
        CopyManager (class in postgresql.copyman) +
        + + +
        Cursor (class in postgresql.api) +
        + + +
        cursor_from_id() (postgresql.api.Database method) +
        + +
        + +

        D

        + + + +
        + +
        daemon_path (postgresql.cluster.Cluster attribute) +
        + + +
        data_directory (postgresql.api.Cluster attribute) +
        + + +
        Database (class in postgresql.api) +
        + + +
        declare() (postgresql.api.Statement method) +
        + + +
        default() (in module postgresql.installation) +
        + + +
        default_buffer_size (in module postgresql.copyman) +
        + + +
        default_errformat() (in module postgresql.sys) +
        + + +
        default_msghook() (in module postgresql.sys) +
        + + +
        default_pg_config() (in module postgresql.installation) +
        + +
        + +
        details (postgresql.api.Message attribute) +
        + + +
        direction (postgresql.api.Cursor attribute) +
        + + +
        Disconnection +
        + + +
        do() (postgresql.api.Database method) +
        + + +
        DPDSEError +
        + + +
        Driver (class in postgresql.api) +
        + + +
        DriverError +
        + + +
        drop() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        +
        + +

        E

        + + + +
        + +
        EREError +
        + + +
        ERIEError +
        + + +
        errformat() (in module postgresql.sys) +
        + + +
        Error +
        + + +
        escape_ident() (in module postgresql.string) +
        + +
        + +
        escape_literal() (in module postgresql.string) +
        + + +
        EscapeCharacterError +
        + + +
        Exception +
        + + +
        execute() (postgresql.api.Database method) +
        + +
        + +

        F

        + + + +
        + +
        FeatureError +
        + +
        + +
        first() (postgresql.api.Statement method) +
        + +
        + +

        G

        + + + +
        + +
        get() (postgresql.api.Settings method) +
        + + +
        get_pid_from_file() (postgresql.cluster.Cluster method) +
        + +
        + +
        getset() (postgresql.api.Settings method) +
        + +
        + +

        H

        + + +
        + +
        hba_file (postgresql.cluster.Cluster attribute) +
        + +
        + +

        I

        + + + +
        + +
        ICVError +
        + + +
        IgnoredClientParameterWarning (class in postgresql.exceptions) +
        + + +
        InconsistentCursorIsolationError +
        + + +
        InFailedTransactionError +
        + + +
        init() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        InitDBError +
        + + +
        initialized() (postgresql.cluster.Cluster method) +
        + + +
        InsecurityError +
        + +
        + +
        Installation (class in postgresql.api) +
        + +
        + +
        (class in postgresql.installation) +
        + +
        + +
        installation (postgresql.api.Cluster attribute) +
        + + +
        IRError +
        + + +
        isconsistent() (postgresql.api.Message method) +
        + + +
        isolation (postgresql.api.Transaction attribute) +
        + + +
        items() (postgresql.api.Settings method) +
        + + +
        iternotifies() (postgresql.api.Database method) +
        + + +
        ITSError +
        + +
        + +

        K

        + + + +
        + +
        keys() (postgresql.api.Settings method) +
        + +
        + +
        kill() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        +
        + +

        L

        + + + +
        + +
        listen() (postgresql.api.Database method) +
        + + +
        listening_channels() (postgresql.api.Database method) +
        + + +
        load_chunks() (postgresql.api.Statement method) +
        + +
        + +
        load_rows() (postgresql.api.Statement method) +
        + + +
        LoadError +
        + + +
        locked() (postgresql.alock.ALock method) +
        + +
        + +

        M

        + + + +
        + +
        map_errors_and_warnings() (in module postgresql.exceptions) +
        + + +
        Message (class in postgresql.api) +
        + + +
        message (postgresql.api.Message attribute) +
        + +
        + +
        mode (postgresql.alock.ALock attribute) +
        + +
        + +
        (postgresql.api.Transaction attribute) +
        + +
        + +
        msghook() (in module postgresql.sys) +
        + +
        + +

        N

        + + + +
        + +
        notify() (postgresql.api.Database method) +
        + +
        + +
        NullProducer (class in postgresql.copyman) +
        + +
        + +

        O

        + + + +
        + +
        OIError +
        + + +
        ONIPSError +
        + +
        + +
        open() (in module postgresql) +
        + + +
        OperationError +
        + +
        + +

        P

        + + + +
        + +
        parameter_types (postgresql.api.Statement attribute) +
        + + +
        pg_column_types (postgresql.api.Statement attribute) +
        + + +
        pg_config_dictionary() (in module postgresql.installation) +
        + + +
        pg_parameter_types (postgresql.api.Statement attribute) +
        + + +
        pg_tmp (in module postgresql.temporal) +
        + + +
        pid (postgresql.cluster.Cluster attribute) +
        + + +
        PLEError +
        + + +
        PLPGSQLError +
        + + +
        PLPGSQLRaiseError +
        + + +
        postgresql (module) +
        + + +
        postgresql.alock (module) +
        + + +
        postgresql.api (module) +
        + +
        + +
        postgresql.cluster (module) +
        + + +
        postgresql.copyman (module) +
        + + +
        postgresql.exceptions (module) +
        + + +
        postgresql.installation (module) +
        + + +
        postgresql.string (module) +
        + + +
        postgresql.sys (module) +
        + + +
        postgresql.temporal (module) +
        + + +
        prepare() (postgresql.api.Database method) +
        + + +
        proc() (postgresql.api.Database method) +
        + + +
        ProducerFault +
        + + +
        ProtocolProducer (class in postgresql.copyman) +
        + +
        + +

        Q

        + + + +
        + +
        qname() (in module postgresql.string) +
        + + +
        quote_ident() (in module postgresql.string) +
        + +
        + +
        quote_ident_if_needed() (in module postgresql.string) +
        + + +
        quote_literal() (in module postgresql.string) +
        + +
        + +

        R

        + + + +
        + +
        read() (postgresql.api.Cursor method) +
        + + +
        ReadOnlyTransactionError +
        + + +
        ready_for_connections() (postgresql.cluster.Cluster method) +
        + + +
        ReceiverFault +
        + + +
        reconcile() (postgresql.copyman.CopyManager method) +
        + + +
        recover() (postgresql.copyman.ProtocolProducer method) +
        + + +
        release() (postgresql.alock.ALock method) +
        + + +
        reload() (postgresql.cluster.Cluster method) +
        + +
        + +
        reset() (postgresql.api.Database method) +
        + + +
        reset_errformat() (in module postgresql.sys) +
        + + +
        reset_msghook() (in module postgresql.sys) +
        + + +
        restart() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        rollback() (postgresql.api.Transaction method) +
        + + +
        rows() (postgresql.api.Statement method) +
        + + +
        running() (postgresql.cluster.Cluster method) +
        + +
        + +

        S

        + + + +
        + +
        SavepointError +
        + + +
        SchemaAndDataStatementsError +
        + + +
        SEARVError +
        + + +
        seek() (postgresql.api.Cursor method) +
        + + +
        ServerNotReadyError +
        + + +
        Settings (class in postgresql.api) +
        + + +
        settings (postgresql.api.Cluster attribute) +
        + +
        + +
        (postgresql.api.Database attribute) +
        + +
        + +
        shutdown() (postgresql.cluster.Cluster method) +
        + + +
        SIOError +
        + + +
        source (postgresql.api.Message attribute) +
        + + +
        split() (in module postgresql.string) +
        + + +
        split_ident() (in module postgresql.string) +
        + + +
        split_qname() (in module postgresql.string) +
        + + +
        split_sql() (in module postgresql.string) +
        + +
        + +
        split_sql_str() (in module postgresql.string) +
        + + +
        split_using() (in module postgresql.string) +
        + + +
        sql_column_types (postgresql.api.Statement attribute) +
        + + +
        sql_parameter_types (postgresql.api.Statement attribute) +
        + + +
        SREError +
        + + +
        ssl (postgresql.api.Installation attribute) +
        + +
        + +
        (postgresql.installation.Installation attribute) +
        + +
        + +
        start() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.api.Transaction method) +
        + + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        Statement (class in postgresql.api) +
        + + +
        statement_from_id() (postgresql.api.Database method) +
        + + +
        statement_id (postgresql.api.Statement attribute) +
        + + +
        stop() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        StoredProcedure (class in postgresql.api) +
        + + +
        string (postgresql.api.Statement attribute) +
        + +
        + +

        T

        + + + +
        + +
        Temporal (class in postgresql.temporal) +
        + + +
        Transaction (class in postgresql.api) +
        + + +
        transfer() (in module postgresql.copyman) +
        + + +
        TRError +
        + +
        + +
        type (postgresql.api.Installation attribute) +
        + + +
        TypeConversionWarning (class in postgresql.exceptions) +
        + + +
        TypeIOError +
        + +
        + +

        U

        + + + +
        + +
        ulong_pack() (in module postgresql.copyman) +
        + + +
        unlisten() (postgresql.api.Database method) +
        + +
        + +
        unsplit() (in module postgresql.string) +
        + + +
        update() (postgresql.api.Settings method) +
        + +
        + +
        (postgresql.copyman.WireState method) +
        + +
        +
        + +

        V

        + + + +
        + +
        values() (postgresql.api.Settings method) +
        + + +
        version (in module postgresql) +
        + +
        + +
        (postgresql.api.Installation attribute) +
        + +
        +
        + +
        version_info (in module postgresql) +
        + +
        + +
        (postgresql.api.Database attribute) +
        + + +
        (postgresql.api.Installation attribute) +
        + +
        +
        + +

        W

        + + + +
        + +
        wait_until_started() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        + +
        wait_until_stopped() (postgresql.api.Cluster method) +
        + +
        + +
        (postgresql.cluster.Cluster method) +
        + +
        +
        + +
        WireState (class in postgresql.copyman) +
        + +
        + +

        X

        + + +
        + +
        xact (postgresql.api.Database attribute) +
        + +
        -
        - -
        @@ -59,7 +1192,7 @@

        Index

        \ No newline at end of file diff --git a/postgresql/documentation/html/gotchas.html b/postgresql/documentation/html/gotchas.html index b00d7d42..45c854a6 100644 --- a/postgresql/documentation/html/gotchas.html +++ b/postgresql/documentation/html/gotchas.html @@ -3,17 +3,20 @@ + - Gotchas — py-postgresql v1.0.2 documentation + Gotchas — py-postgresql 1.0.4 documentation + + - - + + @@ -34,12 +37,15 @@

        Navigation

        index
      • - modules |
      • +
      • + next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -154,8 +160,8 @@

        Previous topic

        Client Parameters

        Next topic

        -

        Changes

        +

        Commands

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/index.html b/postgresql/documentation/html/index.html index b89675be..22eee427 100644 --- a/postgresql/documentation/html/index.html +++ b/postgresql/documentation/html/index.html @@ -3,17 +3,20 @@ + - py-postgresql — py-postgresql v1.0.2 documentation + py-postgresql — py-postgresql 1.0.4 documentation + + - + @@ -32,10 +35,13 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -125,12 +131,6 @@

        ContentsStrange TypeError using load_rows() or load_chunks() -
      • Changes -
      • @@ -143,6 +143,27 @@

        Referencepostgresql.bin.pg_dotconf +
      • Modules +
      • + + + +
        +

        ChangesΒΆ

        +
        @@ -194,6 +215,9 @@

        Table Of Contents

      • Reference
      • +
      • Changes
          +
        +
      • Sample Code
      • @@ -210,7 +234,7 @@

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/lib.html b/postgresql/documentation/html/lib.html index 38cc4914..4d355708 100644 --- a/postgresql/documentation/html/lib.html +++ b/postgresql/documentation/html/lib.html @@ -3,17 +3,20 @@ + - Categories and Libraries — py-postgresql v1.0.2 documentation + Categories and Libraries — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -54,7 +60,7 @@

        Categories and Libraries

        Note

        -

        First-time users are encouraged to read the Audience and Motivation +

        First-time users are encouraged to read the Audience and Motivation section first.

        Libraries are a collection of SQL statements that can be bound to a @@ -105,7 +111,7 @@

        Writing Librariesget_user_info and get_user_info_v2 are identical. Empty components indicate the default effect.

        The second component in the section identifier is the symbol type. All Symbol -types are listed in Symbol Types. This can be +types are listed in Symbol Types. This can be used to specify what the section’s contents are or when to bind the symbol:

        Then executed:

        >>> # Runs the 'refsym' SQL, and creates a Bound Symbol using the results.
        @@ -487,7 +493,7 @@ 

        Audience and MotivationTerminologyΒΆ

        The following terms are used throughout this chapter:

        -
        +
        Annotations
        The information of about a Symbol describing what it is and how it should be used.
        @@ -520,7 +526,7 @@

        Terminology
      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • \ No newline at end of file diff --git a/postgresql/documentation/html/modules.html b/postgresql/documentation/html/modules.html new file mode 100644 index 00000000..dad997a5 --- /dev/null +++ b/postgresql/documentation/html/modules.html @@ -0,0 +1,2160 @@ + + + + + + + + + + Modules — py-postgresql 1.0.4 documentation + + + + + + + + + + + + + + + +
        +
        +
        +
        + +
        +

        ModulesΒΆ

        +

        Modules intended for general use.

        +
        +

        postgresqlΒΆ

        +

        py-postgresql is a Python package for using PostgreSQL. This includes low-level +protocol tools, a driver(PG-API and DB-API), and cluster management tools.

        +

        If it’s not documented in the narratives, postgresql.documentation.index, then +the stability of the APIs should not be trusted.

        +

        See <http://postgresql.org> for more information about PostgreSQL.

        +
        +
        +postgresql.version = '1.0.4'ΒΆ
        +

        The version string of py-postgresql.

        +
        + +
        +
        +postgresql.version_info = (1, 0, 4)ΒΆ
        +

        The version triple of py-postgresql: (major, minor, patch).

        +
        + +
        +
        +postgresql.open(iri=None, prompt_title=None, **kw)ΒΆ
        +

        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.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_errformat(val)ΒΆ
        +

        Built-in error formatter. DON’T TOUCH!

        +
        + +
        +
        +postgresql.sys.default_msghook(msg, format_message=<function format_element at 0x102bd4380>)ΒΆ
        +

        Built-in message hook. DON’T TOUCH!

        +
        + +
        +
        +postgresql.sys.errformat(*args, **kw)ΒΆ
        +

        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)ΒΆ
        +

        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.sys.reset_errformat(with_func=<function errformat at 0x102bab2f8>)ΒΆ
        +

        restore the original excformat function

        +
        + +
        +
        +postgresql.sys.reset_msghook(with_func=<function msghook at 0x102bab408>)ΒΆ
        +

        restore the original msghook function

        +
        + +
        +
        +
        +

        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.escape_ident(text)ΒΆ
        +

        Replace every instance of ” with “”

        +
        + +
        +
        +postgresql.string.escape_literal(text)ΒΆ
        +

        Replace every instance of ‘ with ‘’

        +
        + +
        +
        +postgresql.string.qname(*args)ΒΆ
        +

        Quote the identifiers and join them using ‘.’

        +
        + +
        +
        +postgresql.string.quote_ident(text)ΒΆ
        +

        Replace every instance of ‘ with and place ‘ on each end

        +
        + +
        +
        +postgresql.string.quote_ident_if_needed(text)ΒΆ
        +

        If needed, replace every instance of ‘”’ with ‘”“’ and place ‘”’ on each end. +Otherwise, just return the text.

        +
        + +
        +
        +postgresql.string.quote_literal(text)ΒΆ
        +

        Escape the literal and wrap it in [single] quotations

        +
        + +
        +
        +postgresql.string.split(text)ΒΆ
        +

        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)ΒΆ
        +

        Split a series of identifiers using the specified separator.

        +
        + +
        +
        +postgresql.string.split_qname(text, maxsplit=-1)ΒΆ
        +

        Call to .split_ident() with a ‘.’ sep parameter.

        +
        + +
        +
        +postgresql.string.split_sql(sql, sep=';')ΒΆ
        +

        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=';')ΒΆ
        +

        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.string.split_using(text, quote, sep='.', maxsplit=-1)ΒΆ
        +

        split the string on the seperator ignoring the separator in quoted areas.

        +

        This is only useful for simple quoted strings. Dollar quotes, and backslash +escapes are not supported.

        +
        + +
        +
        +postgresql.string.unsplit(splitted_iter)ΒΆ
        +

        catenate a split string. This is needed to handle the special +cases created by pg.string.split(). (Run-away quotations, primarily)

        +
        + +
        +
        +

        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.AuthenticationMethodError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverError, postgresql.exceptions.Disconnection

        +

        Server requested an authentication method that is not supported by the +driver.

        +
        + +
        +
        +exception postgresql.exceptions.CFError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Configuration File Error

        +
        + +
        +
        +exception postgresql.exceptions.CardinalityError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Wrong number of rows returned

        +
        + +
        +
        +exception postgresql.exceptions.ClientCannotConnectError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ConnectionError

        +

        Client was unable to establish a connection to the server.

        +
        + +
        +
        +exception postgresql.exceptions.ConnectTimeoutError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverError, postgresql.exceptions.Disconnection

        +

        Client was unable to esablish a connection in the given time

        +
        + +
        +
        +exception postgresql.exceptions.ConnectionDoesNotExistError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ConnectionError

        +

        The connection is closed or was never connected.

        +
        + +
        +
        +exception postgresql.exceptions.ConnectionFailureError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ConnectionError

        +

        Raised when a connection is dropped

        +
        + +
        +
        +exception postgresql.exceptions.DPDSEError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Dependent Privilege Descriptors Still Exist

        +
        + +
        +
        +exception postgresql.exceptions.DisconnectionΒΆ
        +

        Bases: postgresql.exceptions.Exception

        +

        Exception identifying errors that result in disconnection

        +
        + +
        +
        +exception postgresql.exceptions.DriverError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Errors originating in the driver’s implementation.

        +
        + +
        +
        +exception postgresql.exceptions.EREError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        External Routine Exception

        +
        + +
        +
        +exception postgresql.exceptions.ERIEError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        External Routine Invocation Exception

        +
        + +
        +
        +exception postgresql.exceptions.Error(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.message.Message, postgresql.exceptions.Exception

        +

        A PostgreSQL Error

        +
        + +
        +
        +exception postgresql.exceptions.EscapeCharacterError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DataError

        +

        Invalid escape character

        +
        + +
        +
        +exception postgresql.exceptions.ExceptionΒΆ
        +

        Bases: builtins.Exception

        +

        Base PostgreSQL exception class

        +
        + +
        +
        +exception postgresql.exceptions.FeatureError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Unsupported feature

        +
        + +
        +
        +exception postgresql.exceptions.ICVError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Integrity Contraint Violation

        +
        + +
        +
        +exception postgresql.exceptions.IRError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Insufficient Resource Error

        +
        + +
        +
        +exception postgresql.exceptions.ITSError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.TransactionError

        +

        Invalid Transaction State

        +
        + +
        +
        +class postgresql.exceptions.IgnoredClientParameterWarning(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverWarning

        +

        Warn the user of a valid, but ignored parameter.

        +
        + +
        +
        +exception postgresql.exceptions.InFailedTransactionError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ITSError

        +

        Occurs when an action occurs in a failed transaction.

        +
        + +
        +
        +exception postgresql.exceptions.InconsistentCursorIsolationError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ITSError

        +

        The held cursor requires the same isolation.

        +
        + +
        +
        +exception postgresql.exceptions.InsecurityError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverError, postgresql.exceptions.Disconnection

        +

        Error signifying a secure channel to a server cannot be established.

        +
        + +
        +
        +exception postgresql.exceptions.LoadErrorΒΆ
        +

        Bases: postgresql.exceptions.Exception

        +

        Failed to load a library

        +
        + +
        +
        +exception postgresql.exceptions.OIError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Operator Intervention

        +
        + +
        +
        +exception postgresql.exceptions.ONIPSError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Object Not In Prerequisite State

        +
        + +
        +
        +exception postgresql.exceptions.OperationError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverError

        +

        An invalid operation on an interface element.

        +
        + +
        +
        +exception postgresql.exceptions.PLEErrorΒΆ
        +

        Bases: builtins.OverflowError

        +

        Program Limit Exceeded

        +
        + +
        +
        +exception postgresql.exceptions.PLPGSQLError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Error raised by a PL/PgSQL procedural function

        +
        + +
        +
        +exception postgresql.exceptions.PLPGSQLRaiseError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.PLPGSQLError

        +

        Error raised by a PL/PgSQL RAISE statement.

        +
        + +
        +
        +exception postgresql.exceptions.ReadOnlyTransactionError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ITSError

        +

        Occurs when an alteration occurs in a read-only transaction.

        +
        + +
        +
        +exception postgresql.exceptions.SEARVError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        Syntax Error or Access Rule Violation

        +
        + +
        +
        +exception postgresql.exceptions.SIOError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        System I/O

        +
        + +
        +
        +exception postgresql.exceptions.SREError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        SQL Routine Exception

        +
        + +
        +
        +exception postgresql.exceptions.SavepointError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.TransactionError

        +

        Classification error designating errors that relate to savepoints.

        +
        + +
        +
        +exception postgresql.exceptions.SchemaAndDataStatementsError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.ITSError

        +

        Mixed schema and data statements not allowed.

        +
        + +
        +
        +exception postgresql.exceptions.ServerNotReadyError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.OIError, postgresql.exceptions.Disconnection

        +

        Thrown when a connection is established to a server that is still starting up.

        +
        + +
        +
        +exception postgresql.exceptions.TRError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.TransactionError

        +

        Transaction Rollback

        +
        + +
        +
        +class postgresql.exceptions.TypeConversionWarning(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverWarning

        +

        Report a potential issue with a conversion.

        +
        + +
        +
        +exception postgresql.exceptions.TypeIOError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.DriverError

        +

        Driver failed to pack or unpack a tuple.

        +
        + +
        +
        +postgresql.exceptions.map_errors_and_warnings(objs, error_container={'': <class 'postgresql.exceptions.Error'>, '--SEC': <class 'postgresql.exceptions.InsecurityError'>, '21000': <class 'postgresql.exceptions.CardinalityError'>, '08004': <class 'postgresql.exceptions.ConnectionRejectionError'>, '34000': <class 'postgresql.exceptions.CursorNameError'>, '08006': <class 'postgresql.exceptions.ConnectionFailureError'>, '23514': <class 'postgresql.exceptions.CheckError'>, '08000': <class 'postgresql.exceptions.ConnectionError'>, '08003': <class 'postgresql.exceptions.ConnectionDoesNotExistError'>, '0B000': <class 'postgresql.exceptions.TransactionInitiationError'>, 'P0001': <class 'postgresql.exceptions.PLPGSQLRaiseError'>, 'P0000': <class 'postgresql.exceptions.PLPGSQLError'>, 'P0003': <class 'postgresql.exceptions.PLPGSQLTooManyRowsError'>, 'P0002': <class 'postgresql.exceptions.PLPGSQLNoDataFoundError'>, '2200M': <class 'postgresql.exceptions.XMLDocumentError'>, '2200L': <class 'postgresql.exceptions.NotXMLError'>, '2200N': <class 'postgresql.exceptions.XMLContentError'>, '2200C': <class 'postgresql.exceptions.EscapeCharacterError'>, '2200B': <class 'postgresql.exceptions.EscapeCharacterConflictError'>, '57P01': <class 'postgresql.exceptions.AdminShutdownError'>, '2200D': <class 'postgresql.exceptions.EscapeOctetError'>, '2200G': <class 'postgresql.exceptions.SpecificTypeMismatch'>, '2200F': <class 'postgresql.exceptions.ZeroLengthString'>, '40001': <class 'postgresql.exceptions.SerializationError'>, '40000': <class 'postgresql.exceptions.TRError'>, '40003': <class 'postgresql.exceptions.StatementCompletionUnknownError'>, '40002': <class 'postgresql.exceptions.IntegrityConstraintViolationError'>, '2D000': <class 'postgresql.exceptions.TransactionTerminationError'>, '42601': <class 'postgresql.exceptions.SyntaxError'>, '2200S': <class 'postgresql.exceptions.XMLCommentError'>, '42602': <class 'postgresql.exceptions.SEARVNameError'>, '2200T': <class 'postgresql.exceptions.XMLProcessingInstructionError'>, '0LP01': <class 'postgresql.exceptions.GrantorOperationError'>, '08001': <class 'postgresql.exceptions.ClientCannotConnectError'>, '53300': <class 'postgresql.exceptions.TooManyConnectionsError'>, '44000': <class 'postgresql.exceptions.WithCheckOptionError'>, '40P01': <class 'postgresql.exceptions.DeadlockError'>, '22008': <class 'postgresql.exceptions.DateTimeFieldOverflowError'>, '22021': <class 'postgresql.exceptions.EncodingError'>, '42846': <class 'postgresql.exceptions.CoercionError'>, '22001': <class 'postgresql.exceptions.StringRightTruncationError'>, '22000': <class 'postgresql.exceptions.DataError'>, '22003': <class 'postgresql.exceptions.NumericRangeError'>, '22002': <class 'postgresql.exceptions.NullValueNoIndicatorParameter'>, '22005': <class 'postgresql.exceptions.AssignmentError'>, '22004': <class 'postgresql.exceptions.NullValueNotAllowedError'>, '22007': <class 'postgresql.exceptions.DateTimeFormatError'>, '42712': <class 'postgresql.exceptions.DuplicateAliasError'>, '3F000': <class 'postgresql.exceptions.SchemaNameError'>, 'XX001': <class 'postgresql.exceptions.DataCorruptedError'>, 'XX000': <class 'postgresql.exceptions.InternalError'>, 'XX002': <class 'postgresql.exceptions.IndexCorruptedError'>, '42710': <class 'postgresql.exceptions.DuplicateObjectError'>, '08P01': <class 'postgresql.exceptions.ProtocolError'>, '53000': <class 'postgresql.exceptions.IRError'>, '38001': <class 'postgresql.exceptions.ContainingSQLNotPermittedError'>, '26000': <class 'postgresql.exceptions.StatementNameError'>, '08007': <class 'postgresql.exceptions.TransactionResolutionUnknownError'>, '3D000': <class 'postgresql.exceptions.CatalogNameError'>, '42611': <class 'postgresql.exceptions.ColumnDefinitionError'>, '0P000': <class 'postgresql.exceptions.RoleSpecificationError'>, '42P20': <class 'postgresql.exceptions.WindowError'>, '09000': <class 'postgresql.exceptions.TriggeredActionError'>, '22018': <class 'postgresql.exceptions.CastCharacterValueError'>, '42501': <class 'postgresql.exceptions.InsufficientPrivilegeError'>, '39P01': <class 'postgresql.exceptions.TriggerProtocolError'>, '39P02': <class 'postgresql.exceptions.SRFProtocolError'>, '22012': <class 'postgresql.exceptions.ZeroDivisionError'>, '22010': <class 'postgresql.exceptions.IndicatorParameterValueError'>, '22011': <class 'postgresql.exceptions.SubstringError'>, '--TIO': <class 'postgresql.exceptions.TypeIOError'>, '22015': <class 'postgresql.exceptions.IntervalFieldOverflowError'>, '0L000': <class 'postgresql.exceptions.GrantorError'>, '25P01': <class 'postgresql.exceptions.NoActiveTransactionError'>, '25P02': <class 'postgresql.exceptions.InFailedTransactionError'>, '22020': <class 'postgresql.exceptions.LimitValueError'>, '39004': <class 'postgresql.exceptions.NullValueNotAllowed'>, '2202E': <class 'postgresql.exceptions.ArrayElementError'>, '39001': <class 'postgresql.exceptions.InvalidSQLState'>, '39000': <class 'postgresql.exceptions.ERIEError'>, '2B000': <class 'postgresql.exceptions.DPDSEError'>, '22P01': <class 'postgresql.exceptions.FloatingPointError'>, '22P03': <class 'postgresql.exceptions.BinaryRepresentationError'>, '22P02': <class 'postgresql.exceptions.TextRepresentationError'>, '22P05': <class 'postgresql.exceptions.UntranslatableCharacterError'>, '22P04': <class 'postgresql.exceptions.BadCopyError'>, '22P06': <class 'postgresql.exceptions.NonstandardUseOfEscapeCharacterError'>, '22027': <class 'postgresql.exceptions.TrimError'>, '22026': <class 'postgresql.exceptions.StringDataLengthError'>, '22025': <class 'postgresql.exceptions.EscapeSequenceError'>, '22024': <class 'postgresql.exceptions.UnterminatedCStringError'>, '22023': <class 'postgresql.exceptions.ParameterValueError'>, '22022': <class 'postgresql.exceptions.IndicatorOverflowError'>, '0F001': <class 'postgresql.exceptions.LocatorSpecificationError'>, '0F000': <class 'postgresql.exceptions.LocatorError'>, '58000': <class 'postgresql.exceptions.SIOError'>, '23503': <class 'postgresql.exceptions.ForeignKeyError'>, '3B000': <class 'postgresql.exceptions.SavepointError'>, '3B001': <class 'postgresql.exceptions.InvalidSavepointSpecificationError'>, '55P03': <class 'postgresql.exceptions.UnavailableLockError'>, '55P02': <class 'postgresql.exceptions.ImmutableRuntimeParameterError'>, 'F0001': <class 'postgresql.exceptions.LockFileExistsError'>, 'F0000': <class 'postgresql.exceptions.CFError'>, '2201B': <class 'postgresql.exceptions.RegularExpressionError'>, '2201F': <class 'postgresql.exceptions.PowerFunctionArgumentError'>, '2201G': <class 'postgresql.exceptions.WidthBucketFunctionArgumentError'>, '2201E': <class 'postgresql.exceptions.LogArgumentError'>, '2201X': <class 'postgresql.exceptions.OffsetValueError'>, '55000': <class 'postgresql.exceptions.ONIPSError'>, '55006': <class 'postgresql.exceptions.ObjectInUseError'>, '42939': <class 'postgresql.exceptions.ReservedNameError'>, '42P09': <class 'postgresql.exceptions.AmbiguousAliasError'>, '42P08': <class 'postgresql.exceptions.AmbiguousParameterError'>, '42P07': <class 'postgresql.exceptions.DuplicateTableError'>, '42P06': <class 'postgresql.exceptions.DuplicateSchemaError'>, '42P05': <class 'postgresql.exceptions.DuplicatePreparedStatementError'>, '42P04': <class 'postgresql.exceptions.DuplicateDatabaseError'>, '42P03': <class 'postgresql.exceptions.DuplicateCursorError'>, '42P02': <class 'postgresql.exceptions.UndefinedParameterError'>, '42P01': <class 'postgresql.exceptions.UndefinedTableError'>, '--cIO': <class 'postgresql.exceptions.CompositeError'>, '57P03': <class 'postgresql.exceptions.ServerNotReadyError'>, '42830': <class 'postgresql.exceptions.ForeignKeyCreationError'>, '57P02': <class 'postgresql.exceptions.CrashShutdownError'>, '24000': <class 'postgresql.exceptions.CursorStateError'>, '58P01': <class 'postgresql.exceptions.UndefinedFileError'>, '58P02': <class 'postgresql.exceptions.DuplicateFileError'>, '27000': <class 'postgresql.exceptions.TriggeredDataChangeViolation'>, '42723': <class 'postgresql.exceptions.DuplicateFunctionError'>, '42725': <class 'postgresql.exceptions.AmbiguousFunctionError'>, '42P18': <class 'postgresql.exceptions.IndeterminateTypeError'>, '42P19': <class 'postgresql.exceptions.RecursionError'>, '42804': <class 'postgresql.exceptions.TypeMismatchError'>, '03000': <class 'postgresql.exceptions.SQLNotYetCompleteError'>, '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'>, '57000': <class 'postgresql.exceptions.OIError'>, '42P16': <class 'postgresql.exceptions.TableDefinitionError'>, '42P17': <class 'postgresql.exceptions.ObjectDefinitionError'>, '53200': <class 'postgresql.exceptions.MemoryError'>, '20000': <class 'postgresql.exceptions.CaseNotFoundError'>, '2F005': <class 'postgresql.exceptions.FunctionExecutedNoReturnStatementError'>, '2F004': <class 'postgresql.exceptions.ReadingDataProhibitedError'>, '2F000': <class 'postgresql.exceptions.SREError'>, '2F003': <class 'postgresql.exceptions.StatementProhibitedError'>, '2F002': <class 'postgresql.exceptions.DataModificationProhibitedError'>, '38004': <class 'postgresql.exceptions.ReadingSQLDataNotPermittedError'>, '38002': <class 'postgresql.exceptions.ModifyingSQLDataNotPermittedError'>, '38003': <class 'postgresql.exceptions.ProhibitedSQLStatementError'>, '38000': <class 'postgresql.exceptions.EREError'>, '42000': <class 'postgresql.exceptions.SEARVError'>, '23000': <class 'postgresql.exceptions.ICVError'>, '23001': <class 'postgresql.exceptions.RestrictError'>, '--PIO': <class 'postgresql.exceptions.ParameterError'>, '57014': <class 'postgresql.exceptions.QueryCanceledError'>, '42803': <class 'postgresql.exceptions.GroupingError'>, '28000': <class 'postgresql.exceptions.AuthenticationSpecificationError'>, '0A000': <class 'postgresql.exceptions.FeatureError'>, '42701': <class 'postgresql.exceptions.DuplicateColumnError'>, '42702': <class 'postgresql.exceptions.AmbiguousColumnError'>, '42703': <class 'postgresql.exceptions.UndefinedColumnError'>, '42704': <class 'postgresql.exceptions.UndefinedObjectError'>, '2BP01': <class 'postgresql.exceptions.DPDSEObjectError'>, '--CIO': <class 'postgresql.exceptions.ColumnError'>, '42883': <class 'postgresql.exceptions.UndefinedFunctionError'>, '25004': <class 'postgresql.exceptions.BadIsolationForBranchError'>, '25005': <class 'postgresql.exceptions.NoActiveTransactionForBranchError'>, '25006': <class 'postgresql.exceptions.ReadOnlyTransactionError'>, '25007': <class 'postgresql.exceptions.SchemaAndDataStatementsError'>, '25000': <class 'postgresql.exceptions.ITSError'>, '25001': <class 'postgresql.exceptions.ActiveTransactionError'>, '25002': <class 'postgresql.exceptions.BranchAlreadyActiveError'>, '25003': <class 'postgresql.exceptions.BadAccessModeForBranchError'>, '--OPE': <class 'postgresql.exceptions.OperationError'>, '23505': <class 'postgresql.exceptions.UniqueError'>, '25008': <class 'postgresql.exceptions.InconsistentCursorIsolationError'>, '23502': <class 'postgresql.exceptions.NotNullError'>, '42P15': <class 'postgresql.exceptions.SchemaDefinitionError'>, '--TOE': <class 'postgresql.exceptions.ConnectTimeoutError'>, '42809': <class 'postgresql.exceptions.WrongObjectTypeError'>, '42622': <class 'postgresql.exceptions.NameTooLongError'>, '22009': <class 'postgresql.exceptions.TimeZoneDisplacementValueError'>, '--000': <class 'postgresql.exceptions.DriverError'>, '--AUT': <class 'postgresql.exceptions.AuthenticationMethodError'>, '2201W': <class 'postgresql.exceptions.LimitValueError'>, '53100': <class 'postgresql.exceptions.DiskFullError'>}, warning_container={'01-TP': <class 'postgresql.exceptions.TypeConversionWarning'>, '02001': <class 'postgresql.exceptions.NoMoreSetsReturned'>, '02000': <class 'postgresql.exceptions.NoDataWarning'>, '01008': <class 'postgresql.exceptions.ImplicitZeroBitPaddingWarning'>, '01006': <class 'postgresql.exceptions.PrivilegeNotRevokedWarning'>, '01007': <class 'postgresql.exceptions.PrivilegeNotGrantedWarning'>, '01004': <class 'postgresql.exceptions.StringDataRightTruncationWarning'>, '01003': <class 'postgresql.exceptions.NullValueEliminatedInSetFunctionWarning'>, '01000': <class 'postgresql.exceptions.Warning'>, '01P01': <class 'postgresql.exceptions.DeprecationWarning'>, '01-CP': <class 'postgresql.exceptions.IgnoredClientParameterWarning'>, '01-00': <class 'postgresql.exceptions.DriverWarning'>, '0100C': <class 'postgresql.exceptions.DynamicResultSetsReturnedWarning'>})ΒΆ
        +

        Construct the code-to-error and code-to-warning associations.

        +
        + +
        +
        +

        postgresql.temporalΒΆ

        +

        Temporary PostgreSQL cluster for the process.

        +
        +
        +class postgresql.temporal.TemporalΒΆ
        +

        Bases: builtins.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()ΒΆ
        +

        S.format(*args, **kwargs) -> str

        +

        Return a formatted version of S, using substitutions from args and kwargs. +The substitutions are identified by braces (‘{‘ and ‘}’).

        +
        + +
        + +
        +
        +postgresql.temporal.pg_tmp = <postgresql.temporal.Temporal object at 0x1024c7c10>ΒΆ
        +

        The process’ temporary cluster.

        +
        + +
        +
        +

        postgresql.installationΒΆ

        +

        Collect and access PostgreSQL installation information.

        +
        +
        +class postgresql.installation.Installation(info)ΒΆ
        +

        Bases: postgresql.api.Installation

        +

        Class providing a Python interface to PostgreSQL installation information.

        +
        +
        +sslΒΆ
        +

        Whether the installation was compiled with SSL support.

        +
        + +
        + +
        +
        +postgresql.installation.default(typ=<class 'postgresql.installation.Installation'>)ΒΆ
        +

        Get the default Installation.

        +

        Uses default_pg_config() to identify the executable.

        +
        + +
        +
        +postgresql.installation.default_pg_config(execname='pg_config', envkey='PGINSTALLATION')ΒΆ
        +

        Get the default pg_config executable on the system.

        +

        If ‘PGINSTALLATION’ is in the environment, use it. +Otherwise, look through the system’s PATH environment.

        +
        + +
        +
        +postgresql.installation.pg_config_dictionary(*pg_config_path)ΒΆ
        +

        Create a dictionary of the information available in the given +pg_config_path. This provides a one-shot solution to fetching information +from the pg_config binary. Returns a dictionary object.

        +
        + +
        +
        +

        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, data_directory)ΒΆ
        +

        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.

        +
        +
        +address()ΒΆ
        +

        Get the host-port pair from the configuration.

        +
        + +
        +
        +connect(**kw)ΒΆ
        +

        Create an established connection from the connector.

        +

        Cluster must be running.

        +
        + +
        +
        +connection(**kw)ΒΆ
        +

        Create a connection object to the cluster, but do not connect.

        +
        + +
        +
        +connector(**kw)ΒΆ
        +

        Create a postgresql.driver connector based on the given keywords and +listen_addresses and port configuration in settings.

        +
        + +
        +
        +daemon_pathΒΆ
        +

        Path to the executable to use to startup the cluster.

        +
        + +
        +
        +drop()ΒΆ
        +

        Stop the cluster and remove it from the filesystem

        +
        + +
        +
        +get_pid_from_file()ΒΆ
        +

        The current pid from the postmaster.pid file.

        +
        + +
        +
        +hba_fileΒΆ
        +

        The path to the HBA file of the cluster.

        +
        + +
        +
        +init(password=None, **kw)ΒΆ
        +

        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.

        +
        + +
        +
        +initialized()ΒΆ
        +

        Whether or not the data directory appears to be a valid cluster.

        +
        + +
        +
        +kill()ΒΆ
        +

        Stop the cluster immediately(SIGKILL).

        +

        Does not wait for shutdown.

        +
        + +
        +
        +pidΒΆ
        +

        If we have the subprocess, use the pid on the object.

        +
        + +
        +
        +ready_for_connections()ΒΆ
        +

        If the daemon is running, and is not in startup mode.

        +

        This only works for clusters configured for TCP/IP connections.

        +
        + +
        +
        +reload()ΒΆ
        +

        Signal the cluster to reload its configuration file.

        +
        + +
        +
        +restart(logfile=None, settings=None, timeout=10)ΒΆ
        +

        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()ΒΆ
        +

        Whether or not the postmaster is running.

        +

        This does not mean the cluster is accepting connections.

        +
        + +
        +
        +shutdown()ΒΆ
        +

        Shutdown the cluster as soon as possible, disconnecting clients.

        +
        + +
        +
        +start(logfile=None, settings=None)ΒΆ
        +

        Start the cluster.

        +
        + +
        +
        +stop()ΒΆ
        +

        Stop the cluster gracefully waiting for clients to disconnect(SIGTERM).

        +
        + +
        +
        +wait_until_started(timeout=10, delay=0.05)ΒΆ
        +

        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=10, delay=0.05)ΒΆ
        +

        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, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Error

        +

        General cluster error.

        +
        + +
        +
        +exception postgresql.cluster.ClusterInitializationError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.cluster.ClusterError

        +

        General cluster initialization failure

        +
        + +
        +
        +exception postgresql.cluster.ClusterNotRunningError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.cluster.ClusterError

        +

        Cluster is not running

        +
        + +
        +
        +exception postgresql.cluster.ClusterStartupError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.cluster.ClusterError

        +

        Cluster startup failed

        +
        + +
        +
        +exception postgresql.cluster.ClusterTimeoutError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.cluster.ClusterError

        +

        Cluster operation timed out

        +
        + +
        +
        +class postgresql.cluster.ClusterWarning(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        Bases: postgresql.exceptions.Warning

        +

        Warning issued by cluster operations

        +
        + +
        +
        +exception postgresql.cluster.InitDBError(message, code=None, details={}, source=None, creator=None)ΒΆ
        +

        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)ΒΆ
        +

        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)ΒΆ
        +

        Bases: builtins.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)ΒΆ
        +

        Bases: postgresql.python.element.Element, _abcoll.Iterator

        +

        A class for managing COPY operations.

        +

        Connects the producer to the receivers.

        +
        +
        +reconcile(r)ΒΆ
        +

        Reconcile a receiver that faulted.

        +

        This method should be used to add back a receiver that failed to +complete its write operation, but is capable of completing the +operation at this time.

        +
        + +
        + +
        +
        +class postgresql.copyman.NullProducerΒΆ
        +

        Bases: postgresql.copyman.Producer

        +

        Produces no copy data.

        +
        + +
        +
        +exception postgresql.copyman.ProducerFault(manager)ΒΆ
        +

        Bases: postgresql.copyman.Fault

        +

        Exception raised when the Producer caused an exception.

        +

        Normally, Producer faults are fatal.

        +
        + +
        +
        +class postgresql.copyman.ProtocolProducer(recv_into, buffer_size=10240)ΒΆ
        +

        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.

        +
        +
        +recover(view)ΒΆ
        +

        Given a view containing data read from the wire, recover the +controller’s state.

        +

        This needs to be implemented by subclasses in order for the +ProtocolReceiver to pass control back to the original state machine.

        +
        + +
        + +
        +
        +exception postgresql.copyman.ReceiverFault(manager, faults)ΒΆ
        +

        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 bytes object at 0x102778260>)ΒΆ
        +

        Bases: builtins.object

        +

        Manages the state of the wire.

        +

        This class manages three possible positions:

        +
        +
          +
        1. Between wire messages
        2. +
        3. Inside message header
        4. +
        5. Inside message (with complete header)
        6. +
        +
        +

        The wire state will become unusable when the configured condition is True.

        +
        +
        +update(view, getlen=<function unpack at 0x102611490>, len=<built-in function len>)ΒΆ
        +

        Given the state of the COPY and new data, advance the position on the +COPY stream.

        +
        + +
        + +
        +
        +postgresql.copyman.default_buffer_size = 10240ΒΆ
        +

        10KB buffer for COPY messages by default.

        +
        + +
        +
        +postgresql.copyman.transfer(producer, *receivers)ΒΆ
        +

        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)ΒΆ
        +

        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>)ΒΆ
        +

        Acquire the locks using the configured identifiers.

        +
        + +
        +
        +locked()ΒΆ
        +

        Whether the locks have been acquired. This method is sensitive to the +connection’s state. If the connection is closed, it will return False.

        +
        + +
        +
        +modeΒΆ
        +

        The mode of the lock class.

        +
        + +
        +
        +release()ΒΆ
        +

        Release the locks using the configured identifiers.

        +
        + +
        + +
        +
        +

        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.MessageΒΆ
        +

        Bases: postgresql.python.element.Element

        +

        A message emitted by PostgreSQL. +A message being a NOTICE, WARNING, INFO, etc.

        +
        +
        +codeΒΆ
        +

        The SQL state code of the message.

        +
        + +
        +
        +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’
        • +
        +
        +
        + +
        +
        +isconsistent(other)ΒΆ
        +

        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.

        +
        + +
        +
        +messageΒΆ
        +

        The primary message string.

        +
        + +
        +
        +sourceΒΆ
        +

        Where the message originated from. Normally, ‘SERVER’, but sometimes +‘CLIENT’.

        +
        + +
        + +
        +
        +class postgresql.api.StatementΒΆ
        +

        Bases: postgresql.python.element.Element, _abcoll.Callable, _abcoll.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
        +
        +
        +
        +
        +chunks(*parameters)ΒΆ
        +

        Return an iterator producing sequences of rows produced by the cursor +created from the statement bound with the given parameters.

        +

        Chunking iterators are never scrollable.

        +

        Supporting cursors will be WITH HOLD when outside of a transaction.

        +

        chunks is designed for moving large data sets efficiently.

        +

        Each iteration returns sequences of rows normally of length(seq) == +chunksize. If chunksize is unspecified, a default, positive integer will +be filled in. The rows contained in the sequences are only required to +support the basic collections.Sequence interfaces; simple and quick +sequence types should be used.

        +
        + +
        +
        +clone()ΒΆ
        +

        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.

        +
        + +
        +
        +close()ΒΆ
        +

        Close the prepared statement releasing resources associated with it.

        +
        + +
        +
        +column(*parameters)ΒΆ
        +

        Return an iterator producing the values of the first column in +the cursor created from the statement bound with the given parameters.

        +

        Column iterators are never scrollable.

        +

        Supporting cursors will be WITH HOLD when outside of a transaction to +allow cross-transaction access.

        +

        column is designed for the situations involving large data sets.

        +

        Each iteration returns a single value. column is equivalent to:

        +
        return map(operator.itemgetter(0), self.rows(*parameters))
        +
        +
        +
        + +
        +
        +column_namesΒΆ
        +

        Abstract Property -> [<class ‘str’>]

        +
        +
        GET::
        +

        The attribute names of the columns produced by the statement.

        +

        A sequence of str objects stating the column name:

        +
        ['column1', 'column2', 'emp_name']
        +
        +
        +
        +
        +
        + +
        +
        +column_typesΒΆ
        +

        Abstract Property -> [<class ‘type’>]

        +
        +
        GET::
        +

        The Python types of the columns produced by the statement.

        +

        A sequence of type objects:

        +
        [<class 'int'>, <class 'str'>]
        +
        +
        +
        +
        + +
        +
        +declare(*parameters)ΒΆ
        +

        Return a scrollable cursor with hold using the statement bound with the +given parameters.

        +
        + +
        +
        +first(*parameters)ΒΆ
        +

        Execute the prepared statement with the given arguments as parameters. +If the statement returns rows with multiple columns, return the first +row. If the statement returns rows with a single column, return the +first column in the first row. If the query does not return rows at all, +return the count or None if no count exists in the completion message.

        +

        Usage:

        +
        >>> db.prepare("SELECT * FROM ttable WHERE key = $1").first("somekey")
        +('somekey', 'somevalue')
        +>>> db.prepare("SELECT 'foo'").first()
        +'foo'
        +>>> db.prepare("INSERT INTO atable (col) VALUES (1)").first()
        +1
        +
        +
        +
        + +
        +
        +load_chunks(iterable)ΒΆ
        +

        Given an iterable, iterable, feed the produced parameters of the chunks +produced by the iterable to the query. This is a bulk-loading interface +for parameterized queries.

        +

        Effectively, it is equivalent to:

        +
        >>> ps = db.prepare(...)
        +>>> for c in iterable:
        +...  for i in c:
        +...   q(*i)
        +
        +
        +

        Its purpose is to allow the implementation to take advantage of the +knowledge that a series of chunks of parameters are to be loaded so +that the operation can be optimized.

        +
        + +
        +
        +load_rows(iterable)ΒΆ
        +

        Given an iterable, iterable, feed the produced parameters to the +query. This is a bulk-loading interface for parameterized queries.

        +

        Effectively, it is equivalent to:

        +
        >>> q = db.prepare(sql)
        +>>> for i in iterable:
        +...  q(*i)
        +
        +
        +

        Its purpose is to allow the implementation to take advantage of the +knowledge that a series of parameters are to be loaded so that the +operation can be optimized.

        +
        + +
        +
        +parameter_typesΒΆ
        +

        Abstract Property -> [<class ‘type’>]

        +
        +
        GET::
        +

        The Python types expected of parameters given to the statement.

        +

        A sequence of type objects:

        +
        [<class 'int'>, <class 'str'>]
        +
        +
        +
        +
        + +
        +
        +pg_column_typesΒΆ
        +

        Abstract Property -> [<class ‘int’>]

        +
        +
        GET::
        +

        The type Oids of the columns produced by the statement.

        +

        A sequence of int objects stating the SQL type name:

        +
        [27, 28]
        +
        +
        +
        +
        +
        + +
        +
        +pg_parameter_typesΒΆ
        +

        Abstract Property -> [<class ‘int’>]

        +
        +
        GET::
        +

        The type Oids of the parameters required by the statement.

        +

        A sequence of int objects stating the PostgreSQL type Oid:

        +
        [27, 28]
        +
        +
        +
        +
        +
        + +
        +
        +rows(*parameters)ΒΆ
        +

        Return an iterator producing rows produced by the cursor +created from the statement bound with the given parameters.

        +

        Row iterators are never scrollable.

        +

        Supporting cursors will be WITH HOLD when outside of a transaction to +allow cross-transaction access.

        +

        rows is designed for the situations involving large data sets.

        +

        Each iteration returns a single row. Arguably, best implemented:

        +
        return itertools.chain.from_iterable(self.chunks(*parameters))
        +
        +
        +
        + +
        +
        +sql_column_typesΒΆ
        +

        Abstract Property -> [<class ‘str’>]

        +
        +
        GET::
        +

        The type of the columns produced by the statement.

        +

        A sequence of str objects stating the SQL type name:

        +
        ['INTEGER', 'VARCHAR', 'INTERVAL']
        +
        +
        +
        +
        +
        + +
        +
        +sql_parameter_typesΒΆ
        +

        Abstract Property -> [<class ‘str’>]

        +
        +
        GET::
        +

        The type of the parameters required by the statement.

        +

        A sequence of str objects stating the SQL type name:

        +
        ['INTEGER', 'VARCHAR', 'INTERVAL']
        +
        +
        +
        +
        +
        + +
        +
        +statement_idΒΆ
        +

        Abstract Property -> <class ‘str’>

        +
        +
        GET::
        +
        The statment’s identifier.
        +
        +
        + +
        +
        +stringΒΆ
        +

        Abstract Property -> <class ‘object’>

        +
        +
        GET::
        +

        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.

        +
        +
        +
        + +
        + +
        +
        +class postgresql.api.CursorΒΆ
        +

        Bases: postgresql.api.Result, _abcoll.Iterator, _abcoll.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.

        +
        +
        +clone()ΒΆ
        +

        Create a new cursor using the same factors as self.

        +
        + +
        +
        +directionΒΆ
        +

        Abstract Property -> <class ‘bool’>

        +
        +
        GET::
        +

        The default direction argument for read().

        +

        When True reads are FORWARD. +When False reads are BACKWARD.

        +

        Cursor operation option.

        +
        +
        +
        + +
        +
        +read(quantity=None, direction=None)ΒΆ
        +

        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.

        +
        + +
        +
        +seek(offset, whence='ABSOLUTE')ΒΆ
        +

        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.

        +
        + +
        + +
        +
        +class postgresql.api.Connector(user=None, password=None, database=None, settings=None, category=None)ΒΆ
        +

        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.CategoryΒΆ
        +

        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.DatabaseΒΆ
        +

        Bases: postgresql.python.element.Element

        +

        The interface to an individual database. Connection objects inherit from +this

        +
        +
        +backend_idΒΆ
        +

        Abstract Property -> (<class ‘int’>, None)

        +
        +
        GET::
        +
        The backend’s process identifier.
        +
        +
        + +
        +
        +client_addressΒΆ
        +

        Abstract Property -> (<class ‘str’>, None)

        +
        +
        GET::
        +

        The client address that the server sees. This is obtainable by querying +the pg_catalog.pg_stat_activity relation.

        +

        None if unavailable.

        +
        +
        +
        + +
        +
        +client_portΒΆ
        +

        Abstract Property -> (<class ‘int’>, None)

        +
        +
        GET::
        +

        The client port that the server sees. This is obtainable by querying +the pg_catalog.pg_stat_activity relation.

        +

        None if unavailable.

        +
        +
        +
        + +
        +
        +cursor_from_id(cursor_id)ΒΆ
        +

        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.

        +
        + +
        +
        +do(language, source)ΒΆ
        +

        Execute a DO statement using the given language and source. +Always returns None.

        +

        Likely to be a function of Connection.execute.

        +
        + +
        +
        +execute(sql)ΒΆ
        +

        Execute an arbitrary block of SQL. Always returns None and raise +an exception on error.

        +
        + +
        +
        +iternotifies(timeout=None)ΒΆ
        +

        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.

        +
        + +
        +
        +listen(*channels)ΒΆ
        +

        Start listening to the given channels.

        +

        Equivalent to issuing “LISTEN <x>” for x in channels.

        +
        + +
        +
        +listening_channels()ΒΆ
        +

        Return an iterator to all the channels currently being listened to.

        +
        + +
        +
        +notify(*channels, **channel_and_payload)ΒΆ
        +

        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.

        +
        + +
        +
        +prepare(sql)ΒΆ
        +

        Create a new Statement instance bound to the connection +using the given SQL.

        +
        >>> s = db.prepare("SELECT 1")
        +>>> c = s()
        +>>> c.next()
        +(1,)
        +
        +
        +
        + +
        +
        +proc(procedure_id)ΒΆ
        +

        Create a StoredProcedure instance using the given identifier.

        +

        The proc_id given can be either an Oid, or a regprocedure +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]
        +
        +
        +
        + +
        +
        +reset()ΒΆ
        +

        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.

        +
        + +
        +
        +settingsΒΆ
        +

        Abstract Property -> <class ‘postgresql.api.Settings’>

        +
        +
        GET::
        +
        A Settings instance bound to the Database.
        +
        +
        + +
        +
        +statement_from_id(statement_id)ΒΆ
        +

        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.

        +
        + +
        +
        +unlisten(*channels)ΒΆ
        +

        Stop listening to the given channels.

        +

        Equivalent to issuing “UNLISTEN <x>” for x in channels.

        +
        + +
        +
        +version_infoΒΆ
        +

        Abstract Property -> <class ‘tuple’>

        +
        +
        GET::
        +

        A version tuple of the database software similar Python’s sys.version_info.

        +
        >>> db.version_info
        +(8, 1, 3, '', 0)
        +
        +
        +
        +
        +
        + +
        +
        +xactΒΆ
        +

        Abstract Property -> <class ‘postgresql.api.Transaction’>

        +
        +
        GET::
        +
        Create a Transaction object using the given keyword arguments as its +configuration.
        +
        +
        + +
        + +
        +
        +class postgresql.api.ConnectionΒΆ
        +

        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.

        +
        +
        +clone()ΒΆ
        +

        Create another connection using the same factors as self. The returned +object should be open and ready for use.

        +
        + +
        +
        +close()ΒΆ
        +

        Close the connection.

        +

        Does nothing if the connection is already closed.

        +
        + +
        +
        +closedΒΆ
        +

        Abstract Property -> <class ‘bool’>

        +
        +
        GET::
        +

        True if the Connection is closed, False if the Connection is +open.

        +
        >>> db.closed
        +True
        +
        +
        +
        +
        +
        + +
        +
        +connect()ΒΆ
        +

        Establish the connection to the server and initialize the category.

        +

        Does nothing if the connection is already established.

        +
        + +
        +
        +connectorΒΆ
        +

        Abstract Property -> <class ‘postgresql.api.Connector’>

        +
        +
        GET::
        +
        The Connector instance facilitating the Connection object’s +communication and initialization.
        +
        +
        + +
        + +
        +
        +class postgresql.api.TransactionΒΆ
        +

        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():
        +...   ...
        +
        +
        +
        +
        +abort()ΒΆ
        +

        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.

        +
        + +
        +
        +begin()ΒΆ
        +

        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, or READ UNCOMMITTED.

        +

        self.mode specifies the mode of the transaction. Normally, READ +ONLY or READ WRITE.

        +

        If the transaction is already open, do nothing.

        +

        If the transaction has been committed or aborted, raise an +postgresql.exceptions.OperationError.

        +
        + +
        +
        +commit()ΒΆ
        +

        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.

        +
        + +
        +
        +isolationΒΆ
        +

        Abstract Property -> (None, <class ‘str’>)

        +
        +
        GET::
        +

        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.

        +
        +
        +
        + +
        +
        +modeΒΆ
        +

        Abstract Property -> (None, <class ‘str’>)

        +
        +
        GET::
        +

        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.

        +
        +
        +
        + +
        +
        +rollback()ΒΆ
        +

        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.

        +
        + +
        +
        +start()ΒΆ
        +

        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, or READ UNCOMMITTED.

        +

        self.mode specifies the mode of the transaction. Normally, READ +ONLY or READ WRITE.

        +

        If the transaction is already open, do nothing.

        +

        If the transaction has been committed or aborted, raise an +postgresql.exceptions.OperationError.

        +
        + +
        + +
        +
        +class postgresql.api.SettingsΒΆ
        +

        Bases: postgresql.python.element.Element, _abcoll.MutableMapping

        +

        A mapping interface to the session’s settings. This provides a direct +interface to SHOW or SET commands. Identifiers and values need +not be quoted specially as the implementation must do that work for the +user.

        +
        +
        +get(key, default=None)ΒΆ
        +

        Get the setting with the corresponding key. If the setting does not +exist, return the default.

        +
        + +
        +
        +getset(keys)ΒΆ
        +

        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.

        +
        + +
        +
        +items()ΒΆ
        +

        Return an iterator to all of the setting value pairs.

        +
        + +
        +
        +keys()ΒΆ
        +

        Return an iterator to all of the settings’ keys.

        +
        + +
        +
        +update(mapping)ΒΆ
        +

        For each key-value pair, incur the effect of the __setitem__ method.

        +
        + +
        +
        +values()ΒΆ
        +

        Return an iterator to all of the settings’ values.

        +
        + +
        + +
        +
        +class postgresql.api.StoredProcedureΒΆ
        +

        Bases: postgresql.python.element.Element, _abcoll.Callable

        +

        A function stored on the database.

        +
        + +
        +
        +class postgresql.api.DriverΒΆ
        +

        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.

        +
        +
        +connect(**kw)ΒΆ
        +

        Create a connection using the given parameters for the Connector.

        +
        + +
        + +
        +
        +class postgresql.api.InstallationΒΆ
        +

        Bases: postgresql.python.element.Element

        +

        Interface to a PostgreSQL installation. Instances would provide various +information about an installation of PostgreSQL accessible by the Python

        +
        +
        +sslΒΆ
        +

        Abstract Property -> <class ‘bool’>

        +
        +
        GET::
        +
        Whether the installation supports SSL.
        +
        +
        + +
        +
        +typeΒΆ
        +

        Abstract Property

        +
        +
        GET::
        +
        The “type” of PostgreSQL. Normally, the first component of the string +returned by pg_config.
        +
        +
        + +
        +
        +versionΒΆ
        +

        Abstract Property

        +
        +
        GET::
        +
        A version string consistent with what SELECT version() would output.
        +
        +
        + +
        +
        +version_infoΒΆ
        +

        Abstract Property

        +
        +
        GET::
        +

        A tuple specifying the version in a form similar to Python’s +sys.version_info. (8, 3, 3, ‘final’, 0)

        +

        See postgresql.versionstring.

        +
        +
        +
        + +
        + +
        +
        +class postgresql.api.ClusterΒΆ
        +

        Bases: postgresql.python.element.Element

        +

        Interface to a PostgreSQL cluster–a data directory. An implementation of +this provides a means to control a server.

        +
        +
        +data_directoryΒΆ
        +

        Abstract Property -> <class ‘str’>

        +
        +
        GET::
        +
        The path to the data directory of the cluster.
        +
        +
        + +
        +
        +drop()ΒΆ
        +

        Kill the server and completely remove the data directory.

        +
        + +
        +
        +init(initdb=None, user=None, password=None, encoding=None, locale=None, collate=None, ctype=None, monetary=None, numeric=None, time=None, text_search_config=None, xlogdir=None)ΒΆ
        +

        Create the cluster at the data_directory associated with the Cluster +instance.

        +
        + +
        +
        +installationΒΆ
        +

        Abstract Property -> <class ‘postgresql.api.Installation’>

        +
        +
        GET::
        +
        The installation used by the cluster.
        +
        +
        + +
        +
        +kill()ΒΆ
        +

        Kill the server.

        +
        + +
        +
        +restart()ΒΆ
        +

        Restart the cluster.

        +
        + +
        +
        +settingsΒΆ
        +

        Abstract Property

        +
        +
        GET::
        +
        A Settings interface to the postgresql.conf file associated with the +cluster.
        +
        +
        + +
        +
        +start()ΒΆ
        +

        Start the cluster.

        +
        + +
        +
        +stop()ΒΆ
        +

        Signal the server to shutdown.

        +
        + +
        +
        +wait_until_started(timeout=10)ΒΆ
        +

        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.

        +
        + +
        +
        +wait_until_stopped(timeout=10)ΒΆ
        +

        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.

        +
        + +
        + +
        +
        + + +
        +
        +
        +
        +
        +

        Table Of Contents

        + + +

        Previous topic

        +

        Commands

        +

        Next topic

        +

        Changes in v1.0

        +

        This Page

        + + + +
        +
        +
        +
        + + + + \ No newline at end of file diff --git a/postgresql/documentation/html/notifyman.html b/postgresql/documentation/html/notifyman.html index 81c2ba56..67b6fcd5 100644 --- a/postgresql/documentation/html/notifyman.html +++ b/postgresql/documentation/html/notifyman.html @@ -3,17 +3,20 @@ + - Notification Management — py-postgresql v1.0.2 documentation + Notification Management — py-postgresql 1.0.4 documentation + + - + @@ -33,13 +36,16 @@

        Navigation

      • index
      • +
      • + modules |
      • next |
      • previous |
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -50,10 +56,6 @@

        Navigation

        Notification ManagementΒΆ

        -
        -

        Warning

        -

        postgresql.notifyman is a new feature in v1.0.

        -

        Relevant SQL commands: NOTIFY, LISTEN, UNLISTEN.

        @@ -191,18 +193,18 @@

        Notification Managers

        Notification Manager ConstructorsΒΆ

        -
        +
        NotificationManager(*connections, timeout = None)
        Create a NotificationManager instance that manages the notifications coming from the given set of connections. The timeout keyword is optional and can be configured using the settimeout method as well.
        -
        +

        Notification Manager Interface PointsΒΆ

        -
        +
        NotificationManager.__iter__()
        Returns the instance; it is an iterator.
        NotificationManager.__next__()
        @@ -225,7 +227,7 @@

        Notification Manager Interface Pointsconnections set, and placed in garbage.

        -
        +

        Zero TimeoutΒΆ

        @@ -252,7 +254,7 @@

        Zero Timeout

        Summary of CharacteristicsΒΆ

        -
          +
          • The iterator will continue until the connections die.
          • Objects yielded by the iterator are either None, an “idle event”, or an individual notification triple if using db.iternotifies(), or a @@ -269,7 +271,7 @@

            Summary of Characteristicsnm.connections set at any time.

          -
        +

        @@ -310,7 +312,7 @@

        This Page

        \ No newline at end of file diff --git a/postgresql/documentation/html/py-modindex.html b/postgresql/documentation/html/py-modindex.html new file mode 100644 index 00000000..7a45f926 --- /dev/null +++ b/postgresql/documentation/html/py-modindex.html @@ -0,0 +1,157 @@ + + + + + + + + + + Python Module Index — py-postgresql 1.0.4 documentation + + + + + + + + + + + + + + + + +
        +
        +
        +
        + + +

        Python Module Index

        + +
        + p +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
         
        + p
        + postgresql +
            + postgresql.alock +
            + postgresql.api +
            + postgresql.cluster +
            + postgresql.copyman +
            + postgresql.exceptions +
            + postgresql.installation +
            + postgresql.string +
            + postgresql.sys +
            + postgresql.temporal +
        + + +
        +
        +
        +
        +
        + + +
        +
        +
        +
        + + + + \ No newline at end of file diff --git a/postgresql/documentation/html/search.html b/postgresql/documentation/html/search.html index 8a0d2f3c..cffd54e9 100644 --- a/postgresql/documentation/html/search.html +++ b/postgresql/documentation/html/search.html @@ -3,17 +3,20 @@ + - Search — py-postgresql v1.0.2 documentation + Search — py-postgresql 1.0.4 documentation + + - + @@ -37,7 +40,10 @@

        Navigation

      • index
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • + modules |
      • +
      • py-postgresql 1.0.4 documentation »
      • @@ -85,13 +91,16 @@

        Navigation

      • index
      • -
      • py-postgresql v1.0.2 documentation »
      • +
      • + modules |
      • +
      • py-postgresql 1.0.4 documentation »
      • \ No newline at end of file diff --git a/postgresql/documentation/html/searchindex.js b/postgresql/documentation/html/searchindex.js index 75fc3f88..a79cc131 100644 --- a/postgresql/documentation/html/searchindex.js +++ b/postgresql/documentation/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{elvi:10,prefix:[8,11,2],iternotifi:[7,6],sleep:8,dirnam:2,sslkeyfil:[6,11],statement_from_id:6,whose:[2,6,5,8,9,11],typeerror:[5,3],"const":2,under:[8,6],connectiondoesnotexisterror:6,everi:[],jack:6,appar:6,pg_src_user:11,direct:[0,2,6,7,9,10],timetzoid:6,second:[8,6,2],even:[8,6],insid:[7,9,6],libpq:[6,11],receive_stmt:9,"new":[0,1,7,6,5,9],python_context:0,metadata:[6,2],psql_:[],createdb:8,never:[7,5,6,2],here:[7,6,2],generate_seri:[9,6,2],path:[0,2,4,6,8,11],ssearch_path:11,interpret:0,precis:9,datetim:6,permit:[],portabl:2,pq_iri:0,user_typ:2,unix:[0,10,6],total:6,pg90:8,describ:[1,9,6,2],would:[5,6,2],call:[8,9,6,11,2],typo:10,recommend:[6,2],type:[1,2,3,6,5,10],until:[1,5,6,7,8,9],notif:[7,3,6],notic:[5,3,6,10],warn:[0,1,3,7,6,5,9,10,11],"__iter__":[7,9],quote_liter:5,relai:6,hold:[7,8,6,2],unpack:[5,10,6],must:[0,1,2,6,7,8,9,11],join:2,restor:6,setup:[4,2],work:[4,3,5,6,2],root:[4,6,11],overrid:[5,10,6,11],alock:[1,10,3],give:[3,6,8],synchron:1,indic:[1,6,11,2,8],unavail:6,want:11,set_config:6,end:[7,6],quot:[5,6],wrap_socket:6,myappdb:2,how:[1,6,2],recoveri:8,env:[],negoti:5,connect_timeout:[6,11],bindir:8,updat:[3,2,6,7,8,11],recogn:[5,6],timedelta:6,after:[0,2,4,6,8,9,10,11],superus:8,befor:[7,8,6,11,2],parameter_typ:6,attempt:[5,11],third:2,credenti:6,perform:[1,9,6,10],includedir:8,environ:[0,3,4,6,8,11],enter:6,exclus:[7,1,6],first:[0,1,2,6,10,11],order:[1,2,5,6,7,8,9],oper:[1,2,4,6,9,10],composit:[5,10,6],feedback:10,over:[8,9,6],becaus:2,smallint:6,fit:6,fix:[5,10],"__class__":8,better:6,absolu:8,them:[2,6,7,9,10,11],thei:[1,2,6,7,8,10,11],fragment:2,get_one_twic:2,"break":[7,9],interrupt:[10,6],sample_copi:6,get_some_row:2,accommod:6,timeout:[7,8,9,6],each:[1,2,6,7,8,9],clustertimeouterror:8,oblig:6,mean:[0,5,2,6,7,8,9,11],pg_restor:8,my_prompt:11,extract:[4,8,6,11],goe:[8,9,6],dst:6,num_byt:9,content:[3,11,2,8],column_typ:6,channel_and_payload:6,reverse_c:6,situat:[7,5,9,6,2],infin:10,free:[6,2],standard:[0,5,6,11,8],driver_set:6,clientparamet:11,sigkil:8,traceback:6,filter:6,unabl:5,confus:[5,6],rang:[6,2],from_iter:2,wast:6,hook:6,unlik:[9,6],mingw:[],mutablemap:6,primari:[3,6,11,2],gogichashvili:10,sometim:[6,2],yesterdai:6,t1980:6,too:[5,3,9],t1985:6,similarli:8,john:[3,6],listen:[7,3,6],consol:0,tool:[8,2],pkgincludedir:8,channel1:6,somewhat:2,pg_:10,target:[0,2,6,5,9,10],keyword:[7,8,6,11,2],provid:[0,1,2,3,5,6,7,8,9,10,11],project:[4,3,10,2],python31:[],ran:[8,9,6],mind:6,rau:10,increment:1,"__main__":0,seen:[0,6],seek:6,dozen:2,cursor_from_id:6,latter:[6,2],transmit:9,prompt_titl:11,simplifi:[7,6,2],sharedir:8,usernam:[0,6,11],object:[0,1,2,7,6,5,8,9,11],deleg:2,refsym:2,regular:[0,7,8],upperbound:10,phase:5,typ:[1,9],prematur:[],don:[10,6,11],simplif:7,doc:[11,2],doe:[3,2,6,5,8,9],declar:[6,2],byteaoid:6,neg:6,dou:10,python_main:0,unlisten:[7,6],random:6,syntax:6,advisori:[1,10,3],pkg:2,identifi:[1,2,6,5,8,9],involv:9,despit:8,pg_src_host:11,layout:[8,2],acquir:[1,6,2,3],"__enter__":[1,9,6],receiverfault:9,ldap:6,"__call__":[5,6],likewis:6,stop:[5,8,6],report:[10,6],ever:5,"public":[6,11],reload:8,bad:[7,10],emp:[3,6],exclusivelock:1,datatyp:6,result:[8,6,11,2],respons:7,fail:[7,5,9,6,10],best:[0,5,9],subject:[5,2,6,7,9,11],preparedstat:2,hopefulli:5,databas:[0,1,2,3,5,6,7,8,11],iri:[0,6,11],default_pg_sysconfdir:11,simplest:6,drawn:5,pg_tmp:[],attribut:[5,2,6,7,8,9,10],inabl:[],extend:[3,6,2,8],wait_until_start:8,extens:[8,6,2],functool:6,intervaloid:6,ilf:2,fault:[3,9],howev:[1,2,4,7,6,5,8,9,11],against:[0,6,2],facet:6,logic:10,com:[10,6],tone:6,pg_driver:6,trust:6,assum:[9,6],union:6,three:[8,6,2],been:[0,1,2,6,7,8,9,11],much:[5,1],total_row:9,basic:[8,2],quickli:[9,6],pgclientencod:11,ani:[1,2,5,6,7,8,9,11],craft:6,listening_channel:6,getpass:[6,11],inhibit:6,ident:2,pg_controldata:8,servic:[7,10,6,11],properti:[1,9,6,2,8],aid:2,faux:8,conf:[0,8,11],get_numb:2,sever:6,numericoid:6,receiv:[0,3,6,7,9,10,11],make:[0,2,6,5,8,9],transpar:6,complex:9,complet:[0,8,9,6],with_libedit_pref:8,rais:[1,3,5,6,7,8,9,10],auser:6,employee_nam:6,undesir:[6,11,2],thu:7,inherit:[10,6,11,2],client:[0,3,6,5,8,11],thi:[0,1,2,4,5,6,7,8,9,11],programm:[5,3,10,2,8],settimeout:7,protocol:[0,1,2,7,6,5,10],statement_id:6,just:[4,6],pranskevichu:10,bandwidth:6,copyout:6,yet:5,languag:[6,2],easi:5,interfer:1,had:[5,6],ideal:[5,6],name_of_databas:3,sym_from_libthat:2,els:[9,2],save:6,procedure_id:6,opt:4,applic:[7,1,6,11,2],get_user_info_v2:2,measur:6,daemon:8,specif:[0,7,9,6,2],arbitrari:[7,8,9,6,2],manual:2,pghost:11,timetz:6,unnecessari:[6,2],timeoid:6,right:7,old:6,deal:[6,11],stopiter:[7,10,9,6],intern:[7,8,6,10],transmiss:[0,6],cooper:1,subclass:1,condit:[7,9,2],foo:6,localhost:[0,8,6,11],varcharoid:6,core:3,client_port:6,scrollabl:[6,2],"super":[],chapter:[0,4,6,2],postgresql:[0,1,2,3,4,5,6,7,8,9,10,11],surround:6,simul:6,commit:6,produc:[3,2,6,7,9,11],libthi:2,"float":6,contriv:[],www:11,down:8,resili:7,server_set:6,wrap:6,wai:[0,5,2,6,7,8,9],support:[1,2,3,6,5,8,10],transform:[5,6,2],avail:[0,1,3,6,7,8,9],gid:10,editor:2,jane:3,overhead:6,interv:[7,6],form:[0,9,6,11,2],offer:[7,1,9,6],forc:6,datestyl:11,pwfile:8,pgpass:[6,11],pgpassword:11,"true":[1,2,6,7,8,11],absent:6,pg_stat_act:6,createus:8,maximum:8,producer_fault:9,absenc:6,fundament:2,sql_parameter_typ:6,emit:[7,5,9,6,10],postmast:8,classif:2,featur:[1,2,3,5,6,7,8,9],alongsid:[1,2],"abstract":[5,1,6,2],t62000:6,exist:[1,9,6,2,8],check:[7,6],when:[0,1,2,3,5,6,7,8,9,10,11],elementtre:10,vacuumdb:8,db_notifi:7,test:[8,6],presum:6,roll:[10,6],relat:5,intend:[9,10],asterisk:11,daemon_path:8,payload_data:6,consid:[5,6,2],sql:[0,7,6,2],grief:6,longer:[9,6],furthermor:[5,6],safe:[7,1,9,6,8],ignor:0,time:[0,1,2,6,7,8],backward:6,appdata:11,consum:[7,9,6],signific:[9,6],row:[3,2,6,5,9,10],depend:[6,11,2],decim:6,decis:5,isinst:9,sourc:[9,6,11,2],"__exit__":[1,9,6],string:[0,2,6,5,8,11],iteratorproduc:9,table2_oid:1,guc:[5,6],administr:[4,3],level:[1,6,5,8,9,10,11],tear:[],valentin:10,reconcil:9,iter:[7,9,6,2],item:[5,8,6],unsupport:[5,3],default_pg_config:[],compens:[9,10],cost:[9,6],infailedtransactionerror:6,port:[0,8,6,11],methodcal:6,current:[1,6,11,8],axel:10,enable_integer_datetim:8,deriv:6,gener:[5,9,6,2],modif:0,address:6,wait:[7,5,6,10,8],srfcomposit:6,my_oper:2,hba:8,queue:7,semant:6,regardless:[1,6,11],extra:[6,2],modul:[0,3,2,6,8,9,10,11],prefer:[0,6],pg_config_:[],pg_dumpal:8,marker:2,instal:[3,2,4,6,8,11],different_channel:6,memori:[8,6,2],mst:6,connector:[5,6,2],employee_dob:6,the_cursor_id:6,msg:6,scope:6,claus:6,ip6:6,templat:6,ip4:6,suffoc:6,prepar:[0,3,2,7,6,5,9,10],timestamptz:[10,6],cat:[0,2],descriptor:6,can:[1,2,5,6,7,8,9,10,11],imped:10,purpos:[5,8,6,11,2],timestampoid:6,unanticip:6,backslash:[0,3,5],critic:6,pq3:6,occur:[7,9,6,11],alwai:[0,1,5,6,8],multipl:[0,1,2,3,6,7,8,10],write:[0,3,6,2,8],usenam:6,getset:[8,6],parameter:[8,6],emp_salai:3,map:[8,9,6,11,2],product:0,clone:6,"__next__":[7,10,9,6],usabl:6,float4oid:6,mai:[1,2,5,6,7,8,9,11],underscor:8,data:[5,2,6,7,8,9],practic:7,johnson:6,stdin:[9,6,2],explicit:[5,1,6,11],channels_and_payload:6,inform:[3,2,6,5,8,9,10,11],"switch":5,cannot:[8,6,2],combin:8,callabl:[9,6],increas:[10,2],xmloid:6,still:[7,10,2],dynam:2,conjunct:6,disconnect:8,platform:11,window:[8,11],main:6,non:[5,8,11,2],encod:[5,8,6],savepoint:[10,6],initi:[5,8,9,6,2],col1:6,now:[7,2],discuss:[0,6,2],sc_number:6,term:[9,2],name:[0,8,6,10,2],untrap:9,drop:[8,6,10],win32:11,reintroduc:9,ters:6,compil:[],domain:[10,6],replac:8,individu:[7,6,2],continu:[7,8,9],borrow:6,year:6,happen:5,shown:6,ct_thi:6,internet:6,correct:[5,3,9,6,10],earlier:6,client_encod:[5,3,11],daemon_process:8,runtimeerror:1,argv:11,orm:2,org:[11,2],"byte":[5,9,6],setupscript:2,care:[6,2],jwp:[0,11],frequenc:7,sysconfdir:[8,11],wrong:5,recov:[7,9],place:[7,6,11,2],lambda:6,origin:[10,9,6],enable_debug:8,directli:[0,1,2,7,6,5,8,9],onc:[7,8,6,2],arrai:[5,3,6,10],acquisit:1,"long":[7,8,6],symmetri:6,oppos:6,open:[3,2,6,8,10,11],given:[0,1,2,7,6,5,8,9,10,11],convent:2,defaultpars:11,caught:6,sslkei:11,conveni:[3,6,10],provinc:2,copi:[3,9,6,10,2],specifi:[0,2,6,7,8,11],than:[8,6,11],denot:2,pgsysconfdir:11,bpcharoid:6,posix:[],were:[5,1,9,6,8],posit:[6,11],"__context__":9,pre:6,rowset:6,argument:[0,8,6,11],dash:8,deliv:7,recover:[9,6],squar:6,destroi:6,libpath:2,note:[8,9,6,11,2],pg_cluster:8,pg_dump:8,take:[0,2,6,5,8,9],noth:3,channel:[7,6],begin:[7,6],sure:6,trace:[0,10,6],normal:[2,4,6,7,8,9,11],buffer:6,standardpars:11,strip_and_int:6,pair:[7,1,6,2,8],later:8,libthat:2,quantiti:6,transaction_isol:6,runtim:[6,2],environ_prefix:11,gracefulli:7,pq_trace:0,serializ:6,show:[0,6],subprocess:8,tend:11,xml:6,onli:[1,2,5,6,7,8,9,11],explicitli:[7,6],loading_t:9,transact:[0,3,6],activ:[7,6],written:6,dict:6,another_set:0,sighup:8,variou:[6,11],get:[7,8,6],ssl:[0,8,6],tailor:10,requir:[0,5,2,6,7,8,9],fileno:6,uniqueerror:6,clustertimeout:[],dramat:5,yield:[7,9,6],postgres_:[],where:[1,2,3,6,7,8,9],summari:7,atabl:6,ipcclean:8,concern:7,timeit:0,detect:6,enough:[5,6],between:[8,6],"import":[0,1,2,3,6,7,8,9,11],parent:8,likeabl:2,cycl:9,come:[5,2,6,7,9,11],pg_ctl_:[],audienc:[3,2],inconsist:[5,8],improv:[3,10],wait_until_stop:8,unittest:[],inspir:0,period:8,table1_oid:1,colon:2,poll:[7,8],ecpg:8,ultim:[5,8,9,6,2],invert:6,configure_opt:8,sslmode:[0,6,11],listen_address:8,with_libxml:8,resolut:[6,11],andrew:3,repres:[7,1,6,8],hasattr:2,default_statistics_target:6,cast:[5,6],invok:[6,2],outcom:6,invoc:[0,6],advantag:[0,6,2],stdout:[0,8,9,6],destin:9,cluster:[0,3,10,8],"__init__":2,develop:[],author:[10,11],same:[7,1,6,2],binari:[5,3,6,10],html:[11,2],cursor_id:6,document:[5,10,2],exhaust:[7,9,6,2],finish:9,closest:6,oid:6,driver:[5,3,6,10,11],capabl:8,mani:[5,9,6,2],appropri:[7,1,5,6,8],without:[0,3,5,7,6],model:6,execut:[0,1,2,3,4,6,5,8,9,10,11],loaderror:10,pkglibdir:8,kill:8,aspect:4,lib2:2,lib1:2,speed:10,hint:[0,5,6,2],pg_sy:2,except:[7,5,9,6,2],param:[0,11,2],codec:5,no_default:11,earli:[7,5],libn:2,read:[0,5,6,2,8],emp_nam:3,world:6,whitespac:2,integ:6,server:[0,5,6,8],benefit:9,either:[7,9,6],output:[0,8,6],manag:[1,2,3,4,6,7,8,9,10,11],fulfil:2,pg_python:[0,3,10,11],definit:[6,2],achiev:6,exit:[0,8,9,6],ddl:2,notabl:[7,8,6,11],refer:[3,2,6,7,9,10],garbag:[7,6],pg_hba:8,broken:[7,9],aquir:1,assocait:[],srf:6,copymanag:9,textoid:6,act:[0,6],table_nam:6,backend_id:[7,6],routin:[5,6],effici:6,lastli:1,filter_notic:6,terminolog:[3,9,2],surviv:1,done_listen:7,employee_salari:6,strip:6,mingw32:[],aren:6,initdberror:8,receiver_fault:9,start:[8,9,6],compliant:5,interfac:[1,2,3,5,6,7,8,9,10,11],ipv4:6,lot:6,ipv6:6,dbapi20:[3,6],total_byt:9,tupl:[5,6,7,8,9,10],pg_hba_:[],pg_parameter_typ:6,tripl:[7,6],possibl:[7,5,6,8],get_emp_with_salary_lt:3,expect:[7,5,6,11,2],creat:[1,2,3,5,6,7,8,9,10],certain:6,strongli:6,file:[0,3,2,4,6,8,10,11],fill:6,again:[1,2,6,7,8,9],field:11,valid:5,writabl:8,you:[4,11],lowerbound:10,sequenc:[5,1,6,2,8],symbol:[3,10,2],timestamptzoid:6,reduc:5,directori:[4,8,11,2],descript:[6,11],hello:6,num_messag:9,potenti:[5,6],escap:6,unset:6,represent:[10,6],all:[0,1,2,3,5,6,7,8,11],illustr:[7,3,6,2],lack:2,abil:[8,6],follow:[0,9,6,11,2],disk:2,chain:2,init:8,program:0,those:[1,2,5,6,7,8,9,11],introduc:5,"case":[1,2,5,6,7,8,9,10,11],liter:[5,3,6,11],straightforward:2,fals:[1,6,11,8],util:11,failur:[7,3,9,6,11],veri:[0,6,2],strang:[5,3],contrib_hstor:6,list:[2,6,7,8,9,10,11],adjust:[5,6],stderr:8,default_port:11,small:6,dimens:6,zero:[7,8,10],design:[7,6,2],stripxx:6,pass:[5,6,2],further:[5,10,6,11,2],whenc:6,what:[6,2],sub:10,section:[5,6,2],abl:6,delet:2,version:[0,4,6,10,8],mandir:8,method:[1,2,3,5,6,7,8,9,10],contrast:6,full:6,variat:2,proper:5,rlock:1,raise_emp:3,excess:6,modifi:[0,8,6],another_generate_series_exampl:2,valu:[0,3,2,6,5,8,10,11],search:2,popen:8,prior:[7,6,2],amount:[7,9,6],pick:7,action:[5,6],introductori:2,via:[7,5,9,6],shorthand:6,pgdatabas:11,primit:1,deprec:10,inappropri:6,establish:[0,3,6,11,2],select:[0,1,2,3,6,9],distinct:6,regist:10,two:[1,6,8],formul:6,taken:[5,6,11],minor:8,more:[3,2,6,5,9,11],desir:[0,3,6,5,8,10],particular:[4,6],known:6,cach:[7,8],psql:[0,8,11],none:[0,2,6,7,8,9,11],remain:[7,6],archiv:4,del:7,def:[6,2],prompt:[0,11],share:[1,6,8],accept:[8,6,11],t72000:6,my_operation_proc:2,cours:[3,6,11],newlin:11,secur:6,rather:[8,9,6,2],anoth:[5,1,9,6,2],snippet:11,pg_config_dictionari:8,simpl:[0,4,6,11,2],vlad:10,resourc:[1,2],referenc:[0,9,6,11,2],variant:[8,11],reflect:6,associ:[1,9,6,8],circumst:[7,6],hstore:[10,6],susan:3,onto:2,caus:[1,2,5,6,7,8,9,10,11],help:0,statementreceiv:9,held:1,through:6,paramet:[0,3,2,7,6,5,8,11],rintavarustu:10,style:2,pgport:11,pend:7,alter:[3,2,6,5,8,10],finer:6,good:[7,2],"return":[0,1,2,6,7,8,9,10,11],timestamp:[10,6],pginstal:[4,11],compound:6,funciton:[],instruct:[6,11],authent:6,easili:[5,6,2],iff:[],alreadi:[8,6,2],die:7,found:2,sql_statements_str:6,procedur:[1,6,2,3],connect:[0,1,2,3,5,6,7,8,9,10,11],beyond:[8,9],event:[7,9,6],transform_row:6,publish:6,payload:[7,6],sym_from_libthi:2,print:[3,6],interrog:[6,11],difficulti:5,postgr:[8,6,11],advanc:[6,2],asc:6,base:[7,8,6,11,2],a_db_us:11,prefac:2,thread:[1,6,10],assign:6,major:[8,6],channel_nam:6,notifi:[7,10,6],number:[0,1,5,6,9],done:[5,6,2],build_ext:[],differ:[6,11],script:[0,2,4,8,10,11],interact:[0,6],construct:[8,9,6,2],statement:[0,3,2,7,6,5,9,10],twenti:6,store:[1,6,3],option:[0,2,6,7,8,11],relationship:6,clusternotrunningerror:8,"_my_oper":2,sql_statement_str:6,pars:[6,11],pgpassfil:[6,11],grace:8,kind:6,celementtre:6,remot:6,remov:[7,8,9,10,11],str:[5,8,6],well:[0,7,5,6,8],pg_directori:8,packag:[4,6,2],dedic:3,"null":10,built:[0,8,2],equival:[6,2],self:2,also:[0,5,6,7,8,9,11],send_stmt:9,employee_hire_d:6,pg_instal:8,distribut:[3,2],choos:[5,1],most:[5,6,11,2],sslrootcrlfil:[6,11],original_except:9,filesystem:0,clear:7,cover:[4,2],setof:6,part:[8,9,6,10],newvalu:0,latest:6,microsoft:8,carefulli:[5,3,6],session:1,fine:[8,6],notifyman:7,indexerror:6,ct_that:6,factor:[9,6,2],ampersand:2,sslrootcrtfil:[6,11],"__file__":2,express:[0,5,6],load_chunk:[5,3,6,2],fastest:6,restart:8,crt:11,int4oid:6,common:[1,6,2],bytea:6,certif:6,forego:6,set:[0,3,2,7,6,5,8,9,10,11],creator:0,clusterinitializationerror:8,startup:[5,10,6],mutabl:6,see:[3,6,11,2],arg:6,close:[0,1,6,7,8,10],inconveni:2,someth:6,altern:9,signatur:[6,2],numer:[3,6],sole:6,libnam:2,ctest:6,verbos:[5,3,6,10],both:[1,2,6,7,8,9],last:6,delimit:6,tempor:10,package_data:2,context:[0,1,9,6,2],default_host:11,pg_column_typ:6,load:[5,6,2],docdir:8,standard_conforming_str:6,simpli:[6,11],point:[1,2,4,6,7,8,9,11],instanti:[1,6,2,8],littl:9,shutdown:8,throughout:2,backend:[7,1,6],user_id:2,due:[6,11],empti:[7,10,6,11,2],secret:[8,6,11],createlang:8,great:6,append:[0,7,2],func:6,demand:6,pg_param:11,look:[5,8,6,2],batch:6,durat:7,"while":[7,8,9,6,2],abov:[1,2,3,6,7,8,11],error:[0,5,6,2],loop:[0,7,9],pack:[5,6],propag:6,readi:[8,9,6,2],itself:[8,6,2],emp_salari:3,clusterdb:8,around:6,decor:[],conflict:[1,6],higher:[5,6],usec:0,optim:5,wherea:[10,6],sym:2,temporari:[0,8],user:[0,3,2,7,6,5,8,10,11],remove_us:2,recent:6,lower:8,lib:[8,10,2],discourag:[6,2],xx9301423:6,entri:[4,6,11,2],chardata:6,itemgett:2,pg_servic:11,pggeqo:11,other_symbol:2,subsequ:[6,11,2],build:[4,8,11,2],bin:[0,3,4,8,10,11],varchar:6,format:[5,6,2],characterist:7,formal:2,success:[1,6],signal:[7,8,9],resolv:[11,2],collect:[3,2,6,7,8,9,11],"boolean":1,pgconnect_timeout:11,specfici:6,often:[7,10,9,6],creation:[6,11,2],some:[1,2,3,5,6,7,11],back:[0,5,6,10],global:2,sampl:[3,6],from_end:6,server_vers:6,backend_start:6,chunksiz:10,per:0,debra:6,substitut:2,larg:[6,2],proc:[0,6,2],run:[0,8,9,6,2],copy_emps_in:6,step:[9,6],that_pkei:6,kerberos4_realm:11,includedir_serv:8,materi:2,optpars:11,idl:[7,6],block:[1,9,6,2,8],postgersql:6,primarili:[8,9,6,11],irrit:10,within:[0,1,2,6,8,9],pgtz:11,ensur:[],fictiti:2,reindexdb:8,textual:6,custom:[5,2],includ:[0,2,4,6,7,8,11],forward:6,parse_arg:11,properli:[5,10,6,11],int4:[1,6,2],line:[0,9,6,11,2],int8:[1,9,6],info:[8,6],utf:[5,8],sql_column_typ:6,consist:[5,6,7,8,9,11],geqo:11,caller:6,highlight:[5,2],similar:[1,6,2],element3:10,constant:[6,2],gettimeout:7,reconcili:9,parser:2,doesn:6,get_some_chunk:2,"char":6,make_emp:3,incomplet:9,destruct:8,guarante:[7,6],titl:11,sequenti:6,invalid:[0,7,6],pguser:[6,11],bracket:6,transport:6,statementproduc:9,pg_config:[4,8],gigabyt:9,infrequ:2,pgdata:[8,11],typeio:10,far:[5,6],name2:6,emps_by_ag:6,scroll:6,getaddrinfo:6,code:[0,3,2,6,7,8],partial:[6,11],pgsslmode:11,queri:[5,10,6,2],setting_name_to_com:0,friendli:6,send:[5,8,6],sens:5,fatal:[5,9,6],sent:[7,5,6,8],rollback:6,volum:5,implicitli:6,relev:7,inclin:6,pgkrbsrvname:11,"try":[9,6],barbara:6,impli:6,natur:[5,9,6,2],client_address:6,index:6,access:[1,2,6,7,8,9,10],absolut:[8,6],len:6,psql_path:8,bodi:6,intnam:6,implicit:6,convert:6,convers:6,larger:6,typio:[5,10],chang:[0,3,2,4,6,5,8,9,10,11],revoc:6,employe:[3,6],configur:[0,2,4,6,7,8],appli:[0,8,6],approxim:7,droplang:8,api:[0,3,2,6,7,9,10],getus:[6,11],from:[0,1,2,3,5,6,7,8,9,10,11],stream:[5,6,2],commun:6,doubl:6,next:[7,9,6],few:[5,8,6,2],usr:[4,8],"0devel":8,pg_data:8,src:[8,6],tzinfo:6,"transient":2,callreceiv:9,name3:6,name1:6,rare:[7,9],interven:6,retriev:8,augment:[0,11],alia:1,annot:2,abort:[9,6],fetch:[6,2],control:[8,9,6],max_connect:8,process:[0,7,2,4,6,5,8,9,11],lock:[1,10,3],tax:2,high:[5,10,9,6,11],tag:10,t1968:6,serial:6,delai:8,filepath:0,pgdatestyl:11,instead:[0,8,6,10,2],panic:[5,6],overridden:5,watch:7,resolve_password:11,unidentifi:[],alloc:[8,9],essenti:[5,2],bind:[10,6,2],dateoid:6,correspond:6,element:[5,10,6],issu:[5,6],allow:[0,1,2,7,6,5,8,10,11],index_from_kei:6,pg_service_fil:11,move:[9,6],dropus:8,infrastructur:6,therefor:[5,8,11,2],fitti:6,greater:[7,6],python:[0,3,2,4,6,5,8,9,10,11],auto:6,auth:[],devel:8,facilit:6,server_encod:[5,6],strive:3,msghook:6,anyth:6,edit:0,enable_cassert:8,prompt_password:11,trap:[9,6],col0:6,tracer:10,chunk:[10,9,6,2],"static":11,patch:8,special:[10,2],out:[7,6,2],variabl:[0,3,6,4,11],get_on:2,parametererror:6,categori:[3,6,2],suitabl:6,rel:[6,2],shut:8,client_min_messag:[5,10,6],manipul:[8,6],dictionari:[8,9,6,11],releas:[1,6,10,3],promptli:[7,6,2],val:[0,1,9],could:1,keep:2,length:6,pg_ctl:8,crl:11,outsid:[6,2],with_openssl:8,retain:[8,2],timezon:[6,11],ttree:6,suffix:2,qualiti:6,echo:0,date:[10,6],facil:[6,2],suffic:11,unknown:6,apply_tax:6,system:[8,11,2],messag:[0,3,7,6,5,9,10],termin:[7,8,6],"final":[9,6,2],prone:2,gotcha:[5,3],exactli:6,notificationmanag:[7,10],take_out_trash:7,mcguffer:6,structur:[8,6],charact:[5,3,6,2],pgsql:8,msec:0,have:[1,2,6,7,8,10,11],tabl:[1,9,6,11,3],need:[1,2,4,7,6,5,8,9,11],localedir:8,preced:8,pg_resetxlog:8,which:[7,1,9,6,2],singl:[0,1,2,3,6,7,10,11],unless:[7,6],writelin:6,search_path:[6,11],rformat:10,t1970:6,kerberos5_servic:11,"class":[1,2,6,7,8,9,10],url:6,request:[5,6,11],recvsiz:10,determin:[8,6,2],fact:6,dbn:7,text:[5,3,6,2],syntaxerror:6,purposefulli:[6,11],bring:5,load_row:[5,3,6,2],trivial:[11,2],redirect:[0,8],locat:[0,3,6,11,8],int8oid:6,forev:7,should:[3,2,4,7,6,5,8,9,11],suppos:6,initdb:8,local:[7,8,6,2],a_statement_id:6,contribut:6,notat:6,regularli:[9,6],unknown_failur:9,db1:7,db2:7,enabl:[5,8,6],organ:2,pgrealm:11,"default":[1,2,3,4,5,6,7,8,10,11],copyin:6,contain:[4,8,6,2],view:6,update_r:9,conform:6,knowledg:[6,2],packet:6,sqlexec:0,op_arg2:2,op_arg1:2,wire:5,pattern:2,boundari:[9,6],copyfail:9,realign:9,state:[8,9,6,11,2],bound:[6,2],kei:[3,9,6,11,8],isol:[8,6,2],itertool:2,"2pc":10,entir:[2,6,5,8,9,11],pgsslkei:11,addit:[7,6,11],etc:[8,6,10,11],instanc:[1,2,5,6,7,8,9,11],grain:[8,6],uncaught:6,sslcrtfile:[6,11],comment:0,respect:[8,2],clusterstartuperror:8,quit:6,solitari:6,addition:[9,6,2],pg_lib:2,libdir:[8,2],compon:[6,2],treat:[5,3,6,2],immedi:[7,8,9,2],producerfault:9,assert:[7,8,2],togeth:[6,2],present:[6,11],cursor:[5,3,6,10,2],defin:[1,6,10,2],faulted_receiv:9,parsed_opt:11,float8oid:6,bigint:[6,2],motiv:[3,2],substanti:3,ready_for_connect:8,enable_depend:8,handl:[7,10,9,6],difficult:5,http:[11,2],hostnam:[6,11],version_info:[8,6],debug:[8,6],upon:[0,8],effect:[4,8,6,11,2],column_nam:6,logfil:8,xact:[0,3,9,6,10],distutil:[4,2],reintroduct:9,exampl:[0,1,7,6,2],command:[0,3,2,6,7,8,10,11],interpol:6,undefin:6,usual:[8,6,2],"25p02":6,less:6,get_user_info:2,smith:6,etre:6,add:[7,10,9,6,2],lookup:11,match:11,py_build_extens:[],piec:6,password:[0,3,6,5,8,11],python3:[0,4,10],insert:[3,6,2],int2oid:6,like:[0,1,2,6,5,8,11],lost:6,necessari:[5,2,6,7,8,9,11],lose:7,page:6,revers:6,twitter:10,pg_dotconf:[0,3,10],user_type_id:2,home:11,librari:[5,3,10,2],mkemp:6,separ:[11,2],lead:[8,6],"__contains__":6,leak:8,avoid:[0,5,9,6,8],leav:11,mode:[0,1,6],preload:2,encourag:2,usag:[0,3,2,6,9,10],host:[0,3,6,11],although:7,about:[5,8,9,6,2],actual:[8,9,6],socket:[0,10,9,6],column:[5,6,2],constructor:[7,1,6],discard:[7,6,2],disabl:[0,6,11],own:10,builtin:[10,9,6],automat:[5,8,6,2],guard:6,copyman:9,mere:[7,1,6,2],leverag:[7,6],processor:5,data_directori:8,transfer:[5,9,6],product_cod:6,information_schema:6,"function":[1,2,6,5,8,9,11],interest:[6,2],unexpect:11,for_rabbit:7,keyerror:6,stdcat:2,pg_execut:8,bug:10,count:[1,6,10,2],succe:6,made:[5,8,6,11,2],temp:[9,6],whether:[1,6,2,8],sc_text:6,dml:[6,2],displai:[6,11],asynchron:[7,6],record:[5,3,9,6,10],key_or_index:6,limit:6,otherwis:6,problem:[5,9,6],"int":[7,8,6,2],dure:[7,5,9,6],pid:[7,8,6],implement:[5,10,9,6,2],ini:2,probabl:5,hba_fil:8,detail:[6,11,2],other:[1,2,3,4,5,6,7,11],bool:[8,6],futur:6,storedprocedur:6,repeat:[8,2],genexpr:6,sharelock:1,the_real_sekrat:6,rule:6,key_from_index:6,portion:6},objtypes:{},titles:["Commands","Advisory Locks","Categories and Libraries","py-postgresql","Administration","Gotchas","Driver","Notification Management","Cluster Management","Copy Management","Changes","Client Parameters"],objnames:{},filenames:["bin","alock","lib","index","admin","gotchas","driver","notifyman","cluster","copyman","changes","clientparameters"]}) \ No newline at end of file +Search.setIndex({objects:{"":{postgresql:[7,0,1,""]},"postgresql.api.Installation":{ssl:[7,6,1,""],version:[7,6,1,""],type:[7,6,1,""],version_info:[7,6,1,""]},"postgresql.api.Cursor":{read:[7,5,1,""],clone:[7,5,1,""],seek:[7,5,1,""],direction:[7,6,1,""]},"postgresql.copyman.CopyManager":{reconcile:[7,5,1,""]},"postgresql.exceptions":{InsecurityError:[7,4,1,""],LoadError:[7,4,1,""],OIError:[7,4,1,""],ERIEError:[7,4,1,""],SIOError:[7,4,1,""],ClientCannotConnectError:[7,4,1,""],InFailedTransactionError:[7,4,1,""],CardinalityError:[7,4,1,""],TRError:[7,4,1,""],IgnoredClientParameterWarning:[7,1,1,""],EREError:[7,4,1,""],PLPGSQLError:[7,4,1,""],PLEError:[7,4,1,""],DriverError:[7,4,1,""],ConnectTimeoutError:[7,4,1,""],IRError:[7,4,1,""],ReadOnlyTransactionError:[7,4,1,""],ITSError:[7,4,1,""],OperationError:[7,4,1,""],ConnectionFailureError:[7,4,1,""],EscapeCharacterError:[7,4,1,""],InconsistentCursorIsolationError:[7,4,1,""],Exception:[7,4,1,""],FeatureError:[7,4,1,""],ONIPSError:[7,4,1,""],map_errors_and_warnings:[7,3,1,""],ICVError:[7,4,1,""],AuthenticationMethodError:[7,4,1,""],SchemaAndDataStatementsError:[7,4,1,""],Disconnection:[7,4,1,""],ServerNotReadyError:[7,4,1,""],Error:[7,4,1,""],ConnectionDoesNotExistError:[7,4,1,""],PLPGSQLRaiseError:[7,4,1,""],DPDSEError:[7,4,1,""],SavepointError:[7,4,1,""],SEARVError:[7,4,1,""],SREError:[7,4,1,""],TypeConversionWarning:[7,1,1,""],CFError:[7,4,1,""],TypeIOError:[7,4,1,""]},"postgresql.copyman.ProtocolProducer":{recover:[7,5,1,""]},"postgresql.api.Settings":{get:[7,5,1,""],keys:[7,5,1,""],items:[7,5,1,""],update:[7,5,1,""],values:[7,5,1,""],getset:[7,5,1,""]},"postgresql.sys":{errformat:[7,3,1,""],default_errformat:[7,3,1,""],msghook:[7,3,1,""],default_msghook:[7,3,1,""],reset_errformat:[7,3,1,""],reset_msghook:[7,3,1,""]},"postgresql.temporal.Temporal":{cluster_dirname:[7,5,1,""]},"postgresql.alock":{ALock:[7,1,1,""]},"postgresql.api":{Category:[7,1,1,""],Connector:[7,1,1,""],Transaction:[7,1,1,""],Installation:[7,1,1,""],Database:[7,1,1,""],Settings:[7,1,1,""],Driver:[7,1,1,""],Cursor:[7,1,1,""],Cluster:[7,1,1,""],Connection:[7,1,1,""],StoredProcedure:[7,1,1,""],Statement:[7,1,1,""],Message:[7,1,1,""]},"postgresql.temporal":{Temporal:[7,1,1,""],pg_tmp:[7,2,1,""]},"postgresql.copyman":{CallReceiver:[7,1,1,""],CopyManager:[7,1,1,""],transfer:[7,3,1,""],ProtocolProducer:[7,1,1,""],WireState:[7,1,1,""],CopyFail:[7,4,1,""],ReceiverFault:[7,4,1,""],ulong_pack:[7,3,1,""],NullProducer:[7,1,1,""],default_buffer_size:[7,2,1,""],ProducerFault:[7,4,1,""]},"postgresql.cluster.Cluster":{wait_until_started:[7,5,1,""],running:[7,5,1,""],ready_for_connections:[7,5,1,""],start:[7,5,1,""],stop:[7,5,1,""],drop:[7,5,1,""],pid:[7,6,1,""],init:[7,5,1,""],wait_until_stopped:[7,5,1,""],daemon_path:[7,6,1,""],connector:[7,5,1,""],reload:[7,5,1,""],connection:[7,5,1,""],kill:[7,5,1,""],connect:[7,5,1,""],shutdown:[7,5,1,""],address:[7,5,1,""],hba_file:[7,6,1,""],initialized:[7,5,1,""],get_pid_from_file:[7,5,1,""],restart:[7,5,1,""]},"postgresql.api.Database":{reset:[7,5,1,""],"do":[7,5,1,""],execute:[7,5,1,""],cursor_from_id:[7,5,1,""],prepare:[7,5,1,""],settings:[7,6,1,""],unlisten:[7,5,1,""],backend_id:[7,6,1,""],version_info:[7,6,1,""],listening_channels:[7,5,1,""],client_port:[7,6,1,""],notify:[7,5,1,""],iternotifies:[7,5,1,""],xact:[7,6,1,""],statement_from_id:[7,5,1,""],proc:[7,5,1,""],client_address:[7,6,1,""],listen:[7,5,1,""]},"postgresql.copyman.WireState":{update:[7,5,1,""]},"postgresql.api.Driver":{connect:[7,5,1,""]},"postgresql.api.Connection":{connector:[7,6,1,""],close:[7,5,1,""],clone:[7,5,1,""],connect:[7,5,1,""],closed:[7,6,1,""]},"postgresql.string":{split_sql_str:[7,3,1,""],split_sql:[7,3,1,""],escape_ident:[7,3,1,""],qname:[7,3,1,""],split_qname:[7,3,1,""],quote_ident_if_needed:[7,3,1,""],split_ident:[7,3,1,""],quote_literal:[7,3,1,""],escape_literal:[7,3,1,""],quote_ident:[7,3,1,""],unsplit:[7,3,1,""],split_using:[7,3,1,""],split:[7,3,1,""]},"postgresql.installation":{"default":[7,3,1,""],default_pg_config:[7,3,1,""],Installation:[7,1,1,""],pg_config_dictionary:[7,3,1,""]},postgresql:{alock:[7,0,1,""],installation:[7,0,1,""],string:[7,0,1,""],version_info:[7,2,1,""],temporal:[7,0,1,""],sys:[7,0,1,""],cluster:[7,0,1,""],api:[7,0,1,""],version:[7,2,1,""],exceptions:[7,0,1,""],copyman:[7,0,1,""],open:[7,3,1,""]},"postgresql.api.Message":{source:[7,6,1,""],message:[7,6,1,""],code:[7,6,1,""],isconsistent:[7,5,1,""],details:[7,6,1,""]},"postgresql.cluster":{ClusterWarning:[7,1,1,""],InitDBError:[7,4,1,""],ClusterInitializationError:[7,4,1,""],ClusterNotRunningError:[7,4,1,""],ClusterError:[7,4,1,""],Cluster:[7,1,1,""],ClusterTimeoutError:[7,4,1,""],ClusterStartupError:[7,4,1,""]},"postgresql.api.Transaction":{begin:[7,5,1,""],rollback:[7,5,1,""],isolation:[7,6,1,""],start:[7,5,1,""],abort:[7,5,1,""],mode:[7,6,1,""],commit:[7,5,1,""]},"postgresql.api.Statement":{column_names:[7,6,1,""],pg_parameter_types:[7,6,1,""],pg_column_types:[7,6,1,""],sql_parameter_types:[7,6,1,""],column:[7,5,1,""],clone:[7,5,1,""],statement_id:[7,6,1,""],load_rows:[7,5,1,""],sql_column_types:[7,6,1,""],chunks:[7,5,1,""],rows:[7,5,1,""],parameter_types:[7,6,1,""],load_chunks:[7,5,1,""],column_types:[7,6,1,""],close:[7,5,1,""],declare:[7,5,1,""],string:[7,6,1,""],first:[7,5,1,""]},"postgresql.installation.Installation":{ssl:[7,6,1,""]},"postgresql.alock.ALock":{release:[7,5,1,""],acquire:[7,5,1,""],locked:[7,5,1,""],mode:[7,6,1,""]},"postgresql.api.Cluster":{installation:[7,6,1,""],settings:[7,6,1,""],drop:[7,5,1,""],stop:[7,5,1,""],wait_until_stopped:[7,5,1,""],start:[7,5,1,""],init:[7,5,1,""],kill:[7,5,1,""],wait_until_started:[7,5,1,""],data_directory:[7,6,1,""],restart:[7,5,1,""]}},terms:{"2200m":7,"2200l":7,"2200n":7,"2200c":7,"2200b":7,"2200d":7,"2200g":7,"2200f":7,elvi:8,prefix:[10,12,2],iternotifi:[9,5,7],sleep:10,dirnam:2,"3d000":7,sslkeyfil:[5,12],statement_from_id:[5,7],"0x101d42508":[],whose:[2,5,6,10,11,12],typeerror:[6,3],"const":2,aut:7,under:[10,5],connectiondoesnotexisterror:[5,7],pg_hba:10,everi:7,deadlockerror:7,reservednameerror:7,jack:5,appar:5,pg_src_user:12,stringdatarighttruncationwarn:7,binaryrepresentationerror:7,seper:7,direct:[0,2,7,5,9,11,8],timetzoid:5,second:[5,7,2,10],duplicateobjecterror:7,even:[5,7,10],insid:[9,5,11,7],libpq:[5,12],receive_stmt:11,"2200t":7,"new":[0,1,6,5,7],python_context:0,metadata:[5,2],timezonedisplacementvalueerror:7,createdb:10,never:[9,5,6,7,2],here:[9,5,7,2],branchalreadyactiveerror:7,generate_seri:[5,11,7,2],path:[0,2,4,7,5,10,12],ssearch_path:12,interpret:0,precis:11,datetim:5,duplicatedatabaseerror:7,dynamicresultsetsreturnedwarn:7,internal_queri:7,portabl:2,pq_iri:0,user_typ:2,unix:[0,5,8],total:5,pg90:10,describ:[1,11,5,2],would:[6,5,7,2],functiondefinitionerror:7,call:[2,7,5,10,11,12],typo:8,recommend:[5,2],type:[1,2,3,7,5,6,8],until:[1,7,6,5,9,10,11],notif:[9,3,5,7],notic:[5,3,6,7,8],warn:[0,1,3,7,5,8,6,12],"__iter__":[9,11],quote_liter:[6,7],relai:5,hold:[9,5,7,2,10],unpack:[6,5,7,8],must:[0,1,2,7,5,9,10,11,12],join:[7,2],"0f001":7,restor:[5,7],setup:[4,8,2],work:[3,2,4,7,5,6],root:[4,5,12],overrid:[6,5,7,12,8],alock:[1,7,8,3],give:[5,3,7,10],synchron:1,indic:[1,2,7,5,10,12],unavail:[5,7],want:12,keep:2,end:[9,5,7],quot:[6,5,7,8],wrap_socket:5,myappdb:2,how:[1,5,8,2],recoveri:[10,7],negoti:6,connect_timeout:[5,12],bindir:10,updat:[3,2,7,5,9,10,12],recogn:[6,5],timedelta:5,cluster_dirnam:7,after:[0,2,4,7,5,8,10,11,12],limitvalueerror:7,superus:10,befor:[9,10,5,12,2],parameter_typ:[5,7],versionstr:7,assignmenterror:7,attempt:[6,7,12],third:2,xmlcontenterror:7,credenti:[5,7],perform:[5,1,11,7,8],pg_dump:10,environ:[0,3,4,7,5,10,12],enter:5,exclus:[9,1,5],first:[0,1,2,7,5,8,12],order:[1,2,7,6,5,9,10,11],oper:[1,2,4,7,5,11,8],macaddr:8,composit:[6,5,8],feedback:8,over:[10,11,5],becaus:2,privileg:7,smallint:5,fit:5,fix:[6,8],"__class__":10,pg_catalog:7,better:5,absolu:10,them:[2,7,5,8,9,11,12],thei:[1,2,7,5,8,9,10,12],fragment:2,safe:[1,7,5,9,10,11],"break":[9,11],interrupt:[5,8],sample_copi:5,get_some_row:2,accommod:[5,7],timeout:[9,5,11,7,10],each:[1,2,7,5,9,10,11],clustertimeouterror:[10,7],oblig:5,mean:[0,6,2,7,5,9,10,11,12],pg_restor:10,typeconversionwarn:7,my_prompt:12,extract:[4,10,5,12],goe:[10,11,5],cursordefinitionerror:7,dst:[5,7],num_byt:11,content:[3,7,12,2,10],column_typ:[5,7],channel_and_payload:[5,7],reverse_c:5,nullvalueeliminatedinsetfunctionwarn:7,"2201b":7,situat:[6,2,7,5,9,11],"2201g":7,free:[5,2],standard:[0,6,5,12,10],"2201x":7,escapecharactererror:7,"2201w":7,driver_set:5,clientparamet:12,sigkil:[10,7],fairli:7,traceback:5,filter:5,unabl:[6,7],onto:2,rang:[5,2],from_iter:[7,2],wast:5,thereof:7,hook:[5,7],unlik:[11,5],alreadi:[5,7,2,10],zerolengthstr:7,mutablemap:[5,7],primari:[5,3,7,12,2],reset_msghook:7,gogichashvili:8,immutableruntimeparametererror:7,sometim:[5,7,2],stringrighttruncationerror:7,crashshutdownerror:7,t1980:5,too:[6,3,11],t1985:5,similarli:10,john:[3,5],listen:[9,3,5,7],consol:0,tool:[10,7,2],pkgincludedir:10,channel1:5,coercionerror:7,incur:7,somewhat:2,termin:[9,5,7,10],target:[0,2,5,6,11,8],keyword:[2,7,5,9,10,12],int4oid:5,ttabl:7,project:[4,3,8,2],lockfileexistserror:7,ran:[5,11,7,10],mind:5,functionexecutednoreturnstatementerror:7,rau:8,increment:1,"__main__":0,seen:[0,5],seek:[5,7],dozen:2,cursor_from_id:[5,7],latter:[5,2],transmit:11,prompt_titl:[7,12],simplifi:[9,5,8,2],sharedir:10,usernam:[0,5,12],user_type_id:2,object:[0,1,2,7,6,5,8,9,10,11,12],icverror:7,deleg:2,grantoroperationerror:7,refsym:2,regular:[0,9,7,10],upperbound:8,phase:6,typ:[1,11,7],xmldocumenterror:7,don:[5,7,12,8],simplif:9,doc:[7,12,2],doe:[3,2,7,5,6,10,11],operationerror:7,declar:[5,7,2],byteaoid:5,neg:5,dou:8,python_main:0,unlisten:[9,5,7],"__str__":7,random:5,syntax:[5,7],advisori:[1,7,8,3],pkg:2,identifi:[1,2,7,5,6,10,11],involv:[11,7],absolut:[5,7,10],pg_src_host:12,layout:[10,2],acquir:[5,1,7,2,3],"__enter__":[1,11,5],receiverfault:[11,7],p0001:7,p0000:7,p0003:7,ldap:5,"__call__":[6,5],likewis:5,stop:[6,5,7,10],duplicatefunctionerror:7,report:[5,7,8],triggeredactionerror:7,ever:6,xmlcommenterror:7,method:[1,2,3,7,6,5,9,10,11,8],reload:[10,7],bad:[9,8],emp:[3,5],proc_id:7,exclusivelock:1,qstr:7,datatyp:5,"2202e":7,columndefinitionerror:7,result:[5,7,12,2,10],respons:[9,7],fail:[6,7,5,9,11,8],best:[0,6,11,7],subject:[6,2,7,5,9,11,12],preparedstat:2,hopefulli:6,databas:[0,1,2,3,5,6,7,9,10,12],notnullerror:7,iri:[0,5,7,12],default_pg_sysconfdir:12,simplest:5,drawn:6,awai:7,pg_tmp:7,internalerror:7,attribut:[6,2,7,5,9,10,11,8],accord:7,extend:[5,3,7,2,10],wait_until_start:[10,7],extens:[10,5,2],functool:5,intervaloid:5,ilf:2,fault:[3,11,7],howev:[1,2,4,6,5,9,10,11,12],against:[0,5,2],unavailablelockerror:7,facet:5,"39p01":7,logic:[7,8],com:[5,8],cursorstateerror:7,duplicatepreparedstatementerror:7,tone:5,foobar:7,pg_driver:5,trust:[5,7],assum:[5,11,7],"42p20":7,srfprotocolerror:7,union:5,three:[5,7,2,10],been:[0,1,2,7,5,9,10,11,12],much:[6,1],total_row:11,basic:[10,7,2],quickli:[11,5],pgclientencod:12,ani:[1,2,7,6,5,9,10,11,12],craft:5,tabledefinitionerror:7,"catch":7,listening_channel:[5,7],dash:10,inhibit:5,ident:[7,2],split_sql:7,pg_controldata:10,servic:[9,5,12,8],properti:[1,2,7,5,10,11],qname:7,aid:2,popen:10,faux:10,kwarg:7,"4dev":[],conf:[0,10,7,12],somekei:7,get_numb:2,sever:[5,7],prior:[9,5,2],receiv:[0,3,7,5,8,9,11,12],make:[0,2,7,5,6,10,11],transpar:5,modifyingsqldatanotpermittederror:7,complex:[11,7],split:7,complet:[0,5,11,7,10],transactionerror:7,default_msghook:7,with_libedit_pref:10,rais:[1,3,7,6,5,9,10,11,8],auser:5,employee_nam:5,protocolerror:7,undesir:[5,12,2],thu:9,inherit:[5,7,12,2,8],client:[0,3,7,5,6,10,12],thi:[0,1,2,4,5,6,7,9,10,11,12],programm:[3,2,7,6,10,8],settimeout:9,protocol:[0,1,2,7,6,5,9,8],statement_id:[5,7],just:[4,5,7],pranskevichu:8,quote_ident_if_necessari:8,bandwidth:5,ambiguousfunctionerror:7,featureerror:7,copyout:5,yet:6,languag:[5,7,2],easi:6,interfer:1,had:[6,5],pg_cluster:10,sym_from_libthat:2,els:[11,2],save:5,procedure_id:[5,7],opt:4,applic:[1,2,7,5,9,12],get_user_info_v2:2,internal_posit:7,"10kb":7,measur:5,daemon:[10,7],specif:[0,2,7,5,9,11],arbitrari:[2,7,5,9,10,11],manual:2,servernotreadyerror:7,pghost:12,timetz:5,unnecessari:[5,2],www:[7,12],right:9,old:5,deal:[5,7,12],negat:7,interv:[9,5,7],objectinuseerror:7,intern:[9,10,5,8],transmiss:[0,5],wirest:7,cooper:1,subclass:[1,7],"0p000":7,tzinfo:5,condit:[9,11,7,2],foo:[5,7],localhost:[0,5,7,12,10],varcharoid:5,core:3,client_port:[5,7],scrollabl:[5,7,2],chapter:[0,4,5,2],postgresql:[0,1,2,3,4,5,6,7,8,9,10,11,12],readingsqldatanotpermittederror:7,escape_id:7,surround:5,simul:5,commit:[5,7],produc:[3,2,7,5,9,11,12],checkerror:7,libthi:2,"float":5,encod:[6,5,7,10],timeoid:5,down:10,resili:9,server_set:5,wrap:[5,7],wai:[0,6,2,7,5,9,10,11],support:[1,2,3,7,5,6,10,8],transform:[6,5,7,2],why:7,avail:[0,1,3,7,5,9,10,11],gid:8,editor:2,jane:3,overhead:5,stopiter:[9,5,11,7,8],form:[0,2,7,5,11,12],offer:[9,1,11,5,7],forc:5,datestyl:12,pwfile:10,pgpass:[5,12],pgpassword:12,cidr:8,"true":[1,2,7,5,9,10,12],reset:7,absent:5,pg_stat_act:[5,7],createus:10,maximum:10,producer_fault:[11,7],absenc:5,fundament:2,sql_parameter_typ:[5,7],emit:[6,7,5,9,11,8],postmast:[10,7],classif:[7,2],featur:[1,2,3,7,5,6,10],alongsid:[1,2],"abstract":[5,1,6,7,2],"42p15":7,t62000:5,exist:[1,2,7,5,10,11],"42p17":7,check:[9,5],when:[0,1,2,3,5,6,7,8,9,10,11,12],elementtre:8,vacuumdb:10,tio:7,db_notifi:9,test:[10,5,8],presum:5,roll:[5,7,8],relat:[6,7],intend:[11,7,8],asterisk:12,daemon_path:[10,7],payload_data:5,consid:[6,5,7,2],sql:[0,9,5,7,2],grief:5,longer:[5,11,7],furthermor:[6,5],ignor:[0,7],time:[0,1,2,7,5,9,10],backward:[5,7],"2201f":7,appdata:12,consum:[9,11,5],"0x102bd4380":7,signific:[11,5],escape_liter:7,recursionerror:7,row:[3,2,7,5,6,11,8],columnreferenceerror:7,depend:[5,7,12,2],"3b000":7,decim:5,decis:[6,7],isinst:11,sourc:[5,11,7,12,2],"__exit__":[1,11,5],string:[0,3,2,7,5,8,6,10,12],iteratorproduc:11,exact:7,table2_oid:1,guc:[6,5],administr:[4,3],level:[1,7,5,8,6,10,11,12],did:7,valentin:8,reconcil:[11,7],iter:[9,5,11,7,2],item:[6,5,7,10],unsupport:[6,3,7],quick:7,default_pg_config:7,irerror:7,"__ne__":7,compens:[11,8],cost:[11,5],infailedtransactionerror:[5,7],port:[0,5,7,12,10],methodcal:5,stringdatalengtherror:7,appear:7,current:[5,1,7,12,10],axel:8,enable_integer_datetim:10,del:9,deriv:5,floatingpointerror:7,gener:[2,7,5,6,11,8],modif:[0,8],execnam:7,address:[5,7],statementprohibitederror:7,wait:[6,7,5,9,10,8],srfcomposit:5,my_oper:2,hba:[10,7],queue:9,semant:5,clientcannotconnecterror:7,prerequisit:7,extra:[5,2],modul:[0,3,2,7,5,8,10,11,12],prefer:[0,5],pg_dumpal:10,marker:2,instal:[3,2,4,7,5,10,12],different_channel:5,memori:[10,5,2],mst:5,connector:[6,5,7,2],employee_dob:5,the_cursor_id:5,"55p03":7,scope:5,escapesequenceerror:7,python:[0,3,2,4,7,5,8,6,10,11,12],claus:5,ctype:7,appendix:7,ip6:5,templat:5,ip4:5,nodatawarn:7,obj:7,suffoc:5,prepar:[0,3,2,7,6,5,9,11,8],timestamptz:[5,8],cat:[0,2],descriptor:[5,7],can:[1,2,7,6,5,8,9,10,11,12],imped:8,purpos:[2,7,5,6,10,12],columnerror:7,timestampoid:5,unanticip:5,backslash:[0,3,6,7],wrapper:7,critic:5,pq3:5,recycl:7,occur:[9,5,11,7,12],alwai:[0,1,7,5,6,10,8],multipl:[0,1,2,3,5,7,9,10,8],transactioninitiationerror:7,"42p09":7,"42p08":7,"42p07":7,"42p06":7,"42p05":7,"42p04":7,"42p03":7,"42p02":7,"42p01":7,write:[0,3,2,7,5,10],parametervalueerror:7,usenam:5,getset:[5,7,10],parameter:[5,7,10],emp_salai:3,map:[2,7,5,10,11,12],product:0,clone:[5,7],"__next__":[9,11,5,8],usabl:5,float4oid:5,succ:7,mai:[1,2,7,6,5,9,10,11,12],underscor:10,data:[6,2,7,5,9,10,11],practic:9,johnson:5,stdin:[5,11,7,2],explicit:[6,1,5,12],channels_and_payload:5,inform:[3,2,7,5,8,6,10,11,12],"switch":6,cannot:[5,7,2,10],combin:10,callabl:[5,11,7],db1:9,xmloid:5,still:[9,7,8,2],pointer:7,dynam:2,snippet:12,conjunct:5,disconnect:[10,7],platform:12,window:[10,12],main:5,non:[6,10,7,12,2],plpgsqltoomanyrowserror:7,savepoint:[5,7,8],initi:[2,7,5,6,10,11],col1:5,includedir:10,now:[9,2],discuss:[0,5,2],sc_number:5,term:[11,2],undefinedcolumnerror:7,name:[0,2,7,5,10,8],untrap:[11,7],drop:[5,7,8,10],win32:12,transactionterminationerror:7,reintroduc:11,ters:5,compil:7,domain:[5,8],replac:[10,7],individu:[9,5,7,2],continu:[9,10,11],dramat:6,year:5,happen:[6,7],substringerror:7,shown:5,ct_thi:5,internet:5,correct:[6,3,11,5,8],insecurityerror:7,earlier:5,client_encod:[6,3,12],state:[2,7,5,10,11,12],variant:[10,12],runtimeerror:1,argv:12,orm:2,org:[7,12,2],"byte":[6,5,11,7],setupscript:2,care:[5,2],jwp:[0,12,8],frequenc:9,sysconfdir:[10,12],wrong:[6,7],recov:[9,11,7],place:[9,5,7,12,2],notxmlerror:7,lambda:5,origin:[5,11,7,8],enable_debug:10,directli:[0,1,2,7,6,5,9,10,11],onc:[9,5,7,2,10],arrai:[6,3,5,8],duplicatetableerror:7,acquisit:[1,7],"long":[9,10,5],symmetri:5,oppos:[5,7],regprocedur:7,open:[3,2,7,5,8,10,12],given:[0,1,2,7,6,5,8,9,10,11,12],silent:7,convent:2,defaultpars:12,caught:5,escapecharacterconflicterror:7,sslkei:12,conveni:[5,3,7,8],duplicatefileerror:7,provinc:2,copi:[3,2,7,5,11,8],specifi:[0,2,7,5,9,10,12],plpgsqlnodatafounderror:7,than:[10,5,12],denot:2,pgsysconfdir:12,duplicateschemaerror:7,bpcharoid:5,were:[1,7,5,6,10,11],posit:[5,7,12],"__context__":11,seri:7,pre:5,rowset:5,argument:[0,5,7,12,10],getpass:[5,12],deliv:9,recover:[11,5],split_sql_str:7,squar:5,destroi:[5,7],libpath:[7,2],note:[2,7,5,10,11,12],ideal:[6,5],"2d000":7,take:[0,2,7,5,6,10,11],command_option_map:7,noth:[3,7],channel:[9,5,7],begin:[9,5,7],sure:[5,7],trace:[0,5,8],normal:[2,4,7,5,9,10,11,12],buffer:[5,7],standardpars:12,detect:[5,7],duplicatecursorerror:[7,8],pair:[1,2,7,5,9,10],msg:[5,7],"42p18":7,"42p19":7,"42p10":7,"42p11":7,"42p12":7,later:10,"42p14":7,libthat:2,"42p16":7,quantiti:[5,7],transaction_isol:5,runtim:[5,7,2],environ_prefix:12,gracefulli:[9,7],pq_trace:0,shot:7,serializ:[5,7],show:[0,5,7],subprocess:[10,7],tend:12,undefinedfileerror:7,xml:5,onli:[1,2,7,6,5,9,10,11,12],explicitli:[9,5,7],loading_t:11,transact:[0,3,5,7],activ:[9,5],behind:7,dict:5,another_set:0,sighup:10,text_search_config:7,variou:[5,7,12],get:[9,5,7,10],ssl:[0,5,7,10],tailor:8,requir:[0,6,2,7,5,9,10,11],fileno:5,searverror:7,uniqueerror:[5,7],borrow:5,yield:[9,5,11,7],where:[1,2,3,7,5,9,10,11],summari:9,sqlnotyetcompleteerror:7,atabl:[5,7],ipcclean:10,split_qnam:7,readonlytransactionerror:7,concern:9,timeit:0,strip_and_int:5,ereerror:7,getlen:7,itserror:7,objectdefinitionerror:7,enough:[6,5],between:[5,7,10],"import":[0,1,2,3,5,7,9,10,11,12],parent:10,likeabl:2,undefinedobjecterror:7,cycl:11,duplicatealiaserror:7,come:[6,2,7,5,9,11,12],pertain:7,audienc:[3,2],ulong_pack:7,format_el:7,mani:[2,7,5,6,11,8],wait_until_stop:[10,7],inspir:0,period:10,table1_oid:1,f0000:7,cferror:7,poll:[9,10],dpdseerror:7,ecpg:10,ultim:[6,10,11,5,2],invert:5,gettimeout:9,unterminatedcstringerror:7,sslmode:[0,5,12],barri:8,listen_address:[10,7],with_libxml:10,resolut:[5,12],andrew:3,"57p03":7,get_some_chunk:2,hasattr:2,default_statistics_target:5,cast:[6,5],invok:[5,7,2],outcom:5,invoc:[0,5,7],privilegenotgrantedwarn:7,advantag:[0,5,7,2],stdout:[0,5,11,7,10],destin:11,cluster:[0,3,7,8,10],undefinedparametererror:7,reset_errformat:7,"__init__":2,develop:8,author:[12,8],same:[9,1,5,7,2],binari:[5,3,6,7,8],html:[7,12,2],cursor_id:[5,7],document:[6,7,8,2],"0f000":7,exhaust:[9,11,5,2],finish:11,closest:5,ambiguouscolumnerror:7,oid:[5,7],driver:[3,7,5,8,6,12],preced:10,capabl:[10,7],improv:[3,8],extern:7,appropri:[1,7,6,5,9,10],inconsist:[6,10],excformat:7,without:[0,3,6,9,5],model:5,execut:[0,1,2,3,4,5,7,8,6,10,11,12],loaderror:[7,8],pkglibdir:10,kill:[10,7],catalognameerror:7,aspect:4,touch:7,lib2:2,lib1:2,speed:8,struct:7,hint:[0,5,6,7,2],pg_sy:2,except:[3,2,7,6,5,9,11,8],littl:11,codec:6,no_default:12,statementnameerror:7,table_nam:5,"0x1025ae1e8":[],envkei:7,around:5,read:[0,2,7,5,6,10],emp_nam:[3,7],world:5,whitespac:2,integ:[5,7],server:[0,5,6,7,10],benefit:11,either:[9,5,11,7],output:[0,5,7,10],manag:[1,2,3,4,5,7,8,9,10,11,12],fulfil:2,unsplit:7,"58p01":7,"58p02":7,pg_python:[0,3,12,8],refresh:7,casenotfounderror:7,definit:[5,2],exit:[0,5,11,7,10],ddl:2,notabl:[9,5,7,12,10],refer:[3,2,7,5,9,11,8],escapeocteterror:7,garbag:[9,5,7],intnam:5,debug:[10,5],droplang:10,undefinedtableerror:7,"throw":7,src:[5,7,10],get_one_twic:2,srf:[5,7],copymanag:[11,7],"3b001":7,textoid:5,activetransactionerror:7,act:[0,5],backend_id:[9,5,7],pg_service_fil:12,effici:[5,7],lastli:1,filter_notic:5,terminolog:[3,11,2],surviv:1,done_listen:9,employee_salari:5,strip:5,encodingerror:7,buffer_s:7,area:7,aren:5,initdberror:[10,7],receiver_fault:[11,7],start:[5,11,7,10],compliant:6,interfac:[1,2,3,7,6,5,8,9,10,11,12],low:7,lot:5,ipv6:5,dbapi20:[3,5],total_byt:11,tupl:[6,7,5,9,10,11,8],"_abcol":7,pg_parameter_typ:[5,7],tripl:[9,5,7],possibl:[9,5,6,7,10],"default":[1,2,3,4,5,6,7,8,9,10,12],"0x102706408":[],sslcrtfile:[5,12],xx400:7,creat:[1,2,3,7,6,5,9,10,11,8],certain:5,strongli:5,file:[0,3,2,4,7,5,8,10,12],fill:[5,7],again:[1,2,5,9,10,11],field:[7,12],valid:[6,7],writabl:10,you:[4,7,12],lowerbound:8,colon:2,sequenc:[1,2,7,5,6,10],symbol:[3,8,2],nullvaluenoindicatorparamet:7,timestamptzoid:5,pool:7,reduc:6,bulk:7,directori:[4,10,7,12,2],descript:[5,12],hello:5,num_messag:11,potenti:[6,5,7],escap:[5,7],warninglookup:7,unset:5,represent:[5,8],all:[0,1,2,3,5,6,7,9,10,12],nametoolongerror:7,illustr:[9,3,5,2],lack:2,dollar:7,nullproduc:7,correl:7,deprecationwarn:7,abil:[5,7,10],follow:[0,2,7,5,11,12],disk:2,chain:[7,2],init:[10,7],program:[0,7],those:[1,2,6,5,9,10,11,12],introduc:6,"case":[1,2,7,6,5,8,9,10,11,12],liter:[5,3,6,7,12],straightforward:2,fals:[5,1,7,12,10],util:12,mechan:7,failur:[3,7,5,9,11,12],veri:[0,5,2],strang:[6,3],cursornameerror:7,contrib_hstor:5,"0x103a1d2f8":[],list:[2,7,5,8,9,10,11,12],adjust:[6,5],stderr:[10,7],default_port:12,small:5,dimens:5,zero:[9,10,7,8],design:[9,5,7,2],stripxx:5,pass:[6,5,7,2],further:[2,7,5,8,6,12],whenc:[5,7],what:[5,7,2],abc:7,sub:8,indexcorruptederror:7,section:[6,5,7,2],abl:5,delet:2,version:[0,4,7,5,10,8],mandir:10,"public":[5,12],contrast:[5,7],querycancelederror:7,full:[5,7],variat:2,rlock:[1,7],infin:8,raise_emp:3,excess:5,"2201e":7,modifi:[0,10,5],another_generate_series_exampl:2,valu:[0,3,2,7,5,8,6,10,12],search:2,"__setitem__":7,numericoid:5,amount:[9,11,5],pick:9,action:[6,5,7],introductori:2,via:[9,5,6,7,11],shorthand:5,pgdatabas:12,primit:1,deprec:8,inappropri:5,triggerprotocolerror:7,establish:[0,3,2,7,5,12],select:[0,1,2,3,7,5,11],distinct:[5,7],regist:8,two:[5,1,7,10],formul:5,taken:[6,5,12],minor:[10,7],more:[3,2,7,5,6,11,12],containingsqlnotpermittederror:7,desir:[0,3,7,5,6,10,8],particular:[4,5,7],known:5,diskfullerror:7,cach:[9,10],psql:[0,10,12],none:[0,2,7,5,9,10,11,12],hous:7,remain:[9,5],archiv:4,searvnameerror:7,def:[5,2],prompt:[0,7,12],scan:7,nullvaluenotallow:7,share:[1,5,10],accept:[5,7,12,10],invalidsavepointspecificationerror:7,t72000:5,connecttimeouterror:7,my_operation_proc:2,cours:[5,3,7,12],newlin:12,secur:[5,7],rather:[5,11,7,2,10],anoth:[1,2,7,5,6,11],"3f000":7,pg_config_dictionari:[10,7],simpl:[0,2,4,7,5,12],vlad:8,resourc:[1,7,2],referenc:[0,2,7,5,11,12],daemon_process:10,reflect:5,connectionfailureerror:7,offset:7,associ:[5,1,11,7,10],stabil:7,circumst:[9,5],hstore:[5,8],susan:3,confus:[6,5],caus:[1,2,7,6,5,8,9,10,11,12],zerodivisionerror:7,help:[0,7],statementreceiv:11,serializationerror:7,soon:7,held:[1,7],through:[5,7],reconnect:7,intervalfieldoverflowerror:7,paramet:[0,3,2,7,6,5,9,10,12],rintavarustu:8,style:2,pgport:12,pend:[9,7],alter:[3,2,7,5,6,10,8],finer:5,good:[9,2],"return":[0,1,2,7,5,8,9,10,11,12],timestamp:[5,8],pginstal:[4,7,12],splitted_it:7,compound:5,transactionresolutionunknownerror:7,isconsist:7,undefinedfunctionerror:7,instruct:[5,7,12],authent:[5,7],mysteri:8,easili:[6,5,2],achiev:5,die:9,found:[7,2],intervent:7,memoryerror:7,sql_statements_str:5,schemanameerror:7,procedur:[5,1,7,2,3],connect:[0,1,2,3,5,6,7,8,9,10,11,12],beyond:[10,11],event:[9,11,5],transform_row:5,publish:[5,7],payload:[9,5,7],sym_from_libthi:2,print:[5,3,7],difficulti:6,postgr:[5,7,12,10],uncommit:7,advanc:[5,7,2],asc:5,cardinalityerror:7,base:[2,7,5,9,10,12],a_db_us:12,thrown:7,prefac:2,thread:[5,1,7,8],esablish:7,assign:5,logfil:[10,7],feed:7,major:[5,7,10],channel_nam:5,notifi:[9,5,7,8],obviou:7,number:[0,1,7,5,6,11],done:[6,5,2],wrongobjecttypeerror:7,differ:[5,7,12],script:[0,2,4,12,10,8],interact:[0,5],construct:[5,11,7,2,10],"0x102428ad0":[],statement:[0,3,2,7,6,5,9,11,8],twenti:5,store:[5,1,7,3],schema:7,option:[0,2,7,5,9,10,12],relationship:5,clusternotrunningerror:[10,7],"_my_oper":2,sql_statement_str:5,pars:[5,7,12],pgpassfil:[5,12],grace:10,adminshutdownerror:7,kind:5,celementtre:5,sreerror:7,remot:[5,7],oierror:7,remov:[7,8,9,10,11,12],str:[6,5,7,10],toe:7,well:[0,6,7,5,9,10],pg_directori:10,implicitzerobitpaddingwarn:7,packag:[4,5,7,2],preparedstatementdefinitionerror:7,dedic:3,"null":8,built:[0,10,7,2],equival:[5,7,2],self:[7,2],violat:7,also:[0,6,7,5,9,10,11,12],build:[4,10,12,2],employee_hire_d:5,brace:7,pg_instal:10,distribut:[3,2],choos:[6,1],"08p01":7,ttree:5,plan:7,sslrootcrlfil:[5,12],original_except:11,connectionerror:7,filesystem:[0,7],clear:9,cover:[4,2],destruct:10,part:[10,11,5,8],newvalu:0,usual:[10,5,2],microsoft:10,"0lp01":7,carefulli:[6,3,5],session:[1,7],fine:[10,5],find:7,notifyman:9,indexerror:5,ct_that:5,erieerror:7,datamodificationprohibitederror:7,solut:7,noactivetransactionforbrancherror:7,format_messag:7,duplicatecolumnerror:7,factor:[5,11,7,2],ampersand:2,sslrootcrtfil:[5,12],unus:7,"__file__":2,express:[0,6,5],load_chunk:[5,3,6,7,2],warning_contain:7,fastest:5,restart:[10,7],untranslatablecharactererror:7,crt:12,schemaanddatastatementserror:7,provid:[0,1,2,3,5,6,7,8,9,10,11,12],numericrangeerror:7,common:[5,1,7,2],column1:7,crl:12,column2:7,certif:5,forego:5,set:[0,3,2,7,6,5,8,9,10,11,12],seq:7,sep:7,clusterinitializationerror:[10,7],startup:[6,5,7,8],mutabl:5,see:[5,3,7,12,2],signifi:7,arg:[5,7],close:[0,1,7,5,9,10,8],pleerror:7,ambiguousaliaserror:7,inconveni:2,someth:5,trerror:7,altern:[11,7],signatur:[5,2],integrityconstraintviolationerror:7,numer:[5,3,7],sole:5,isol:[5,7,2,10],ctest:5,both:[1,2,5,9,10,11],last:5,delimit:5,tempor:[3,7,8],default_excformat:7,package_data:2,context:[0,1,2,7,5,11],default_host:12,pg_column_typ:[5,7],load:[6,5,7,2],docdir:10,standard_conforming_str:5,simpli:[5,7,12],point:[1,2,4,7,5,9,10,11,12],instanti:[5,1,7,2,10],rolespecificationerror:7,header:7,param:[0,12,2],shutdown:[10,7],throughout:2,backend:[9,1,5,7],contraint:7,user_id:2,due:[5,12],empti:[2,7,5,8,9,12],secret:[10,5,12],recv_into:7,xmlprocessinginstructionerror:7,createlang:10,convert:5,append:[0,9,2],map_errors_and_warn:7,func:5,demand:5,pg_param:12,look:[6,5,7,2,10],batch:5,durat:[9,7],formatt:7,"while":[2,7,5,9,10,11],abov:[1,2,3,5,9,10,12],error:[0,5,6,7,2],loop:[0,9,11,7],pack:[6,5,7],propag:5,nomoresetsreturn:7,readi:[5,11,7,2,10],itself:[5,7,2,10],emp_salari:3,triggereddatachangeviol:7,clusterdb:10,libn:2,weakref:8,decor:7,grant:8,grantorerror:7,conflict:[1,5],higher:[6,5,7],usec:0,optim:[6,7],sioerror:7,wherea:[5,7,8],sym:2,temporari:[0,10,7],user:[0,3,2,7,6,5,8,9,10,12],yesterdai:5,recent:5,lower:10,lib:[10,8,2],discourag:[5,2],xx9301423:5,entri:[4,5,7,12,2],"42p13":7,pickl:8,withcheckoptionerror:7,chardata:5,itemgett:[7,2],regardless:[1,5,12],pg_servic:12,split_id:7,pggeqo:12,badcopyerror:7,other_symbol:2,subsequ:[5,7,12,2],bin:[0,3,4,12,10,8],"0l000":7,dataerror:7,varchar:[5,7],format:[6,5,7,2],"0x1024c7c10":7,characterist:9,databasedefinitionerror:7,formal:2,success:[1,5],signal:[9,10,11,7],resolv:[12,2],collect:[3,2,7,5,9,10,11,12],"boolean":1,pgconnect_timeout:12,specfici:5,often:[9,5,11,7,8],creation:[5,12,2],some:[1,2,3,6,5,9,12],back:[0,5,6,7,8],global:2,unspecifi:7,sampl:[3,5],from_end:[5,7],server_vers:5,backend_start:5,chunksiz:[7,8],per:0,debra:5,substitut:[7,2],larg:[5,7,2],proc:[0,5,7,2],machin:7,run:[0,2,7,5,10,11],copy_emps_in:5,reach:7,ignoredclientparameterwarn:7,step:[11,5],that_pkei:5,nullvaluenotallowederror:7,kerberos4_realm:12,includedir_serv:10,materi:2,optpars:12,idl:[9,5],block:[1,2,7,5,10,11],postgersql:5,real:7,primarili:[5,11,7,12,10],irrit:8,within:[0,1,2,5,10,11],pgtz:12,statment:7,purposefulli:[5,12],fictiti:2,reindexdb:10,textual:5,custom:[6,2],protocolproduc:7,includ:[0,2,4,7,5,9,10,12],forward:[5,7],datacorruptederror:7,parse_arg:12,properli:[6,5,12,8],powerfunctionargumenterror:7,int4:[1,5,2],"55p02":7,line:[0,2,7,5,11,12],int8:[1,11,5],info:[5,7,10],savepointerror:7,utf:[6,10],sql_column_typ:[5,7],consist:[6,7,5,9,10,11,12],geqo:12,caller:5,cio:7,highlight:[6,2],similar:[5,1,7,2],f0001:7,element3:8,constant:[5,2],configure_opt:10,reconcili:11,parser:2,"57p01":7,doesn:5,repres:[1,7,5,9,10,8],"char":5,make_emp:3,incomplet:11,setof:5,guarante:[9,5,7],titl:12,sequenti:5,invalid:[0,9,5,7],pguser:[5,12],bracket:5,transport:5,statementproduc:11,pg_config:[4,10,7],logargumenterror:7,onipserror:7,gigabyt:11,caten:7,indicatorparametervalueerror:7,infrequ:2,typeio:8,far:[6,5],callreceiv:[11,7],emps_by_ag:5,scroll:5,getaddrinfo:5,code:[0,3,2,7,5,9,10],with_func:7,pgsslmode:12,queri:[6,5,7,8,2],setting_name_to_com:0,sensit:7,friendli:5,send:[6,10,5],sens:6,fatal:[6,5,11,7],clusterwarn:7,sent:[9,5,6,7,10],rollback:[5,7],volum:6,implicitli:5,relev:9,xlogdir:7,inclin:5,pgkrbsrvname:12,"try":[5,11,7],barbara:5,impli:5,natur:[6,11,5,2],inconsistentcursorisolationerror:7,odd:7,plpgsqlerror:7,send_stmt:11,index:[5,7],access:[1,2,7,5,9,10,11,8],despit:10,insufficientprivilegeerror:7,len:[5,7],psql_path:10,bodi:[5,7],privilegenotrevokedwarn:7,becom:7,implicit:5,great:5,convers:[5,7],broken:[9,11],quote_ident_if_need:7,larger:5,client_address:[5,7],grussl:8,typio:[6,8],earli:[9,6],chang:[0,3,2,4,5,8,6,10,11,12],revoc:5,employe:[3,5],configur:[0,2,4,7,5,9,10],appli:[0,5,7,10],approxim:9,aquir:1,expect:[6,2,7,5,9,12],api:[0,3,2,7,5,9,11,8],getus:[5,12],from:[0,1,2,3,5,6,7,8,9,10,11,12],stream:[6,5,7,2],commun:[5,7],doubl:5,next:[9,5,11,7],few:[6,10,5,2],usr:[4,10],"0devel":10,pg_data:10,inet:8,get_pid_from_fil:7,comparison:7,datetimefieldoverflowerror:7,p0002:7,pgdata:[10,12],"transient":[7,2],name2:5,name3:5,name1:5,rare:[9,11],socket:[0,11,5,8],retriev:10,augment:[0,12],alia:1,maxsplit:7,annot:2,abort:[5,11,7],clustererror:7,fetch:[5,7,2],control:[5,11,7,10],arrayelementerror:7,max_connect:10,process:[0,6,2,4,7,5,9,10,11,12],lock:[1,7,8,3],readingdataprohibitederror:7,tax:2,high:[7,5,8,6,11,12],tag:8,schemadefinitionerror:7,t1968:5,serial:5,delai:[10,7],nonstandarduseofescapecharactererror:7,xx001:7,xx000:7,xx002:7,narr:7,pgdatestyl:12,indeterminatetypeerror:7,instead:[0,2,7,5,10,8],panic:[6,5],errcod:7,overridden:6,watch:9,resolve_password:12,pg_ctl:[10,7],"0x1025ae2f8":[],alloc:[10,11],essenti:[6,2],bind:[5,8,2],filepath:0,correspond:[5,7],connectionrejectionerror:7,issu:[6,5,7],allow:[0,1,2,7,6,5,8,9,10,12],"2f005":7,"2f004":7,index_from_kei:5,"2f003":7,routin:[6,5,7],move:[5,11,7],dropus:10,pg_proc:7,infrastructur:5,therefor:[6,10,12,2],fitti:5,greater:[9,5],handl:[9,5,11,7,8],auto:5,devel:10,facilit:[5,7],server_encod:[6,5],somevalu:7,strive:[3,7],msghook:[5,7],anyth:5,edit:0,enable_cassert:10,resourcewarn:8,specifictypemismatch:7,prompt_password:12,trap:[5,11,7],tracer:8,default_errformat:7,chunk:[5,11,7,8,2],textrepresentationerror:7,"static":[7,12],patch:[10,7,8],special:[7,8,2],out:[9,5,7,2],variabl:[0,3,5,4,12],get_on:2,parametererror:[5,7],categori:[5,3,7,2],suitabl:5,rel:[5,7,2],merg:8,"0a000":7,shut:10,client_min_messag:[6,5,8],manipul:[10,5],dictionari:[5,11,7,12,10],releas:[5,1,7,8],promptli:[9,5,2],val:[0,1,11,7],unquot:7,could:1,set_config:5,length:[5,7],bytea:5,outsid:[5,7,2],with_openssl:10,retain:[10,2],timezon:[5,12],softwar:7,suffix:2,qualiti:5,echo:0,date:[5,8],remove_us:2,facil:[5,2],suffic:12,locatorerror:7,quote_id:[7,8],strict:7,unknown:5,apply_tax:5,system:[10,7,12,2],messag:[0,3,7,6,5,9,11,8],datetimeformaterror:7,pg_:8,"final":[5,11,7,2],prone:2,gotcha:[6,3],"0x102bab408":7,exactli:5,notificationmanag:[9,8],take_out_trash:9,mcguffer:5,prohibitedsqlstatementerror:7,charact:[5,3,6,7,2],groupingerror:7,sec:7,castcharactervalueerror:7,pgsql:[10,7],dateoid:5,msec:0,have:[1,2,7,5,8,9,10,12],tabl:[1,3,7,5,11,12],need:[1,2,4,7,6,5,9,10,11,12],element:[6,5,7,8],badisolationforbrancherror:7,drivererror:7,authenticationmethoderror:7,mix:7,localedir:10,name_of_databas:3,pg_resetxlog:10,which:[1,2,7,5,9,11],singl:[0,1,2,3,5,7,8,9,12],unless:[9,5,7],writelin:5,search_path:[5,12],rformat:8,t1970:5,kerberos5_servic:12,"class":[1,2,7,5,9,10,11,8],restricterror:7,url:5,request:[6,5,7,12],recvsiz:8,determin:[10,5,2],fact:5,dbm:7,dbn:9,text:[5,3,6,7,2],syntaxerror:[5,7],verbos:[6,3,5,8],bring:6,load_row:[5,3,6,7,2],trivial:[12,2],"2f000":7,redirect:[0,10],"0x102611490":7,locat:[0,3,5,12,10],"2bp01":7,"2f002":7,int8oid:5,forev:9,should:[3,2,4,7,6,5,9,10,11,12],offsetvalueerror:7,suppos:5,initdb:[10,7],local:[9,5,7,2,10],a_statement_id:5,contribut:5,notat:5,error_contain:7,reappli:7,regularli:[11,5],unknown_failur:11,increas:[8,2],db2:9,enabl:[6,10,5],organ:2,pgrealm:12,get_emp_with_salary_lt:3,foreignkeyerror:7,copyin:5,integr:7,contain:[4,5,7,2,10],regularexpressionerror:7,view:[5,7],update_r:11,conform:5,widthbucketfunctionargumenterror:7,pqv3:7,knowledg:[5,7,2],noactivetransactionerror:7,packet:5,sqlexec:0,op_arg2:2,op_arg1:2,wire:[6,7],pattern:2,boundari:[11,5],copyfail:[11,7],realign:11,written:5,bound:[5,7,2],kei:[3,7,5,10,11,12],"0x102bab2f8":7,libnam:2,itertool:[7,2],"2pc":8,entir:[2,5,6,10,11,12],pgsslkei:12,addit:[9,5,7,12],"40p01":7,protocolreceiv:7,equal:7,etc:[5,8,7,12,10],instanc:[1,2,7,6,5,9,10,11,12],grain:[10,5],uncaught:5,sigterm:7,"0100c":7,comment:0,structur:[10,5],respect:[10,7,2],ambiguousparametererror:7,clusterstartuperror:[10,7],quit:5,solitari:5,addition:[5,11,7,2],pg_lib:2,quotat:7,libdir:[10,2],insuffici:7,compon:[5,7,2],treat:[6,3,5,2],immedi:[9,10,11,7,2],partial:[5,12],producerfault:[11,7],assert:[9,10,7,2],pronam:7,togeth:[5,2],present:[5,12],typeioerror:7,cursor:[3,2,7,5,6,8],defin:[5,1,7,8,2],faulted_receiv:11,parsed_opt:12,trimerror:7,float8oid:5,default_buffer_s:7,driverwarn:7,bigint:[5,2],motiv:[3,2],substanti:[3,7],ready_for_connect:[10,7],split_us:7,enable_depend:10,cross:7,matthew:8,difficult:6,http:[7,12,2],hostnam:[5,12],version_info:[5,7,10],interrog:[5,12],"39p02":7,upon:[0,10],effect:[2,4,7,5,10,12],column_nam:[5,7],creator:[0,7],col0:5,xact:[0,3,7,5,11,8],collat:7,distutil:[4,2],reintroduct:11,col:7,exampl:[0,1,9,5,2],command:[0,3,2,7,5,8,9,10,12],interpol:[5,7],undefin:[5,7],latest:5,"25p01":7,"25p02":[5,7],less:5,obtain:7,tcp:7,authenticationspecificationerror:7,"22p01":7,"22p03":7,"22p02":7,"22p05":7,"22p04":7,"22p06":7,get_user_info:2,smith:5,etre:5,add:[2,7,5,9,11,8],reason:7,lookup:12,match:12,badaccessmodeforbrancherror:7,piec:5,arguabl:7,errorlookup:7,password:[0,3,7,5,6,10,12],python3:[0,4,8],insert:[5,3,7,2],int2oid:5,like:[0,1,2,7,5,6,10,12],lost:5,"2b000":7,necessari:[6,2,7,5,9,10,11,12],lose:9,soft:7,page:5,exceed:7,revers:5,"57p02":7,foreignkeycreationerror:7,twitter:8,pg_dotconf:[0,3,8],proper:[6,7],home:12,librari:[6,3,7,8,2],mkemp:5,separ:[7,12,2],indicatoroverflowerror:7,lead:[10,5],"__contains__":5,leak:10,avoid:[0,6,11,5,10],leav:12,ipv4:5,"0x102778260":7,pg_config_path:7,mode:[0,1,5,7],preload:2,encourag:2,usag:[0,3,2,7,5,11,8],host:[0,3,5,7,12],although:9,compositeerror:7,invalidsqlst:7,monetari:7,about:[2,7,5,6,10,11],actual:[5,11,7,10],interven:5,column:[6,5,7,2],"01p01":7,constructor:[9,1,5,7],discard:[9,5,2],disabl:[0,5,12],toomanyconnectionserror:7,own:8,builtin:[5,11,7,8],automat:[6,10,5,2],guard:5,copyman:[3,11,7],mere:[9,1,5,2],leverag:[9,5],processor:6,data_directori:[10,7],transfer:[6,5,11,7],product_cod:5,statementcompletionunknownerror:7,"0b000":7,plpgsqlraiseerror:7,overflowerror:7,information_schema:5,"function":[1,2,7,5,6,10,11,12],interest:[5,2],unexpect:12,locatorspecificationerror:7,for_rabbit:9,typemismatcherror:7,keyerror:[5,7],stdcat:2,pg_execut:10,bug:8,count:[5,1,7,8,2],succe:5,made:[6,10,5,12,2],temp:[11,5],whether:[5,1,7,2,10],sc_text:5,dml:[5,2],displai:[5,7,12],asynchron:[9,5],record:[3,7,5,6,11,8],key_or_index:5,limit:[5,7],otherwis:[5,7],problem:[6,11,5],errformat:7,pio:7,"int":[9,5,7,2,10],dure:[9,6,11,5],pid:[9,5,7,10],implement:[2,7,5,6,11,8],ini:2,probabl:6,hba_fil:[10,7],tranact:7,dpdseobjecterror:7,detail:[5,7,12,2],other:[1,2,3,4,5,6,7,9,12],bool:[5,7,10],futur:5,most:[6,5,7,12,2],storedprocedur:[5,7],repeat:[10,2],fulli:7,genexpr:5,sharelock:1,stai:7,the_real_sekrat:5,rule:[5,7],key_from_index:5,portion:[5,7],windowerror:7},objtypes:{"0":"py:module","1":"py:class","2":"py:data","3":"py:function","4":"py:exception","5":"py:method","6":"py:attribute"},titles:["Commands","Advisory Locks","Categories and Libraries","py-postgresql","Administration","Driver","Gotchas","Modules","Changes in v1.0","Notification Management","Cluster Management","Copy Management","Client Parameters"],objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","data","Python data"],"3":["py","function","Python function"],"4":["py","exception","Python exception"],"5":["py","method","Python method"],"6":["py","attribute","Python attribute"]},filenames:["bin","alock","lib","index","admin","driver","gotchas","modules","changes-v1.0","notifyman","cluster","copyman","clientparameters"]}) \ No newline at end of file diff --git a/postgresql/documentation/modules.txt b/postgresql/documentation/modules.txt new file mode 100644 index 00000000..133ce779 --- /dev/null +++ b/postgresql/documentation/modules.txt @@ -0,0 +1,93 @@ +Modules +======= + +Modules intended for general use. + +:mod:`postgresql` +----------------- + +.. automodule:: postgresql +.. autodata:: version +.. autodata:: version_info +.. autofunction:: open + + +:mod:`postgresql.sys` +--------------------- + +.. automodule:: + postgresql.sys + :members: + :show-inheritance: + + +:mod:`postgresql.string` +------------------------ + +.. automodule:: + postgresql.string + :members: + :show-inheritance: + + +:mod:`postgresql.exceptions` +---------------------------- + +.. automodule:: + postgresql.exceptions + :members: + :show-inheritance: + + +:mod:`postgresql.temporal` +-------------------------- + +.. automodule:: + postgresql.temporal + :members: + :show-inheritance: + + +:mod:`postgresql.installation` +------------------------------ + +.. automodule:: + postgresql.installation + :members: + :show-inheritance: + + +:mod:`postgresql.cluster` +------------------------- + +.. automodule:: + postgresql.cluster + :members: + :show-inheritance: + + +:mod:`postgresql.copyman` +------------------------- + +.. automodule:: + postgresql.copyman + :members: + :show-inheritance: + + +:mod:`postgresql.alock` +----------------------- + +.. automodule:: + postgresql.alock + :members: + :show-inheritance: + + +:mod:`postgresql.api` +--------------------- + +.. automodule:: + postgresql.api + :members: + :show-inheritance: diff --git a/postgresql/documentation/sphinx/build.sh b/postgresql/documentation/sphinx/build.sh index 2826aa43..ef482e0b 100755 --- a/postgresql/documentation/sphinx/build.sh +++ b/postgresql/documentation/sphinx/build.sh @@ -2,5 +2,6 @@ mkdir -p ../html/doctrees cp ../*.txt ./ cp index.rst index.txt +cp modules.rst modules.txt sphinx-build -E -b html -d ../html/doctrees . ../html cd ../html && pwd diff --git a/postgresql/documentation/sphinx/conf.py b/postgresql/documentation/sphinx/conf.py index 3ec7904d..be731f8d 100644 --- a/postgresql/documentation/sphinx/conf.py +++ b/postgresql/documentation/sphinx/conf.py @@ -12,13 +12,12 @@ # serve to show the default value. import sys, os -sys.path.insert(0, '.') sys.dont_write_bytecode = True # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -sys.path.insert(0, os.path.abspath('../../')) +sys.path.insert(0, os.path.abspath('../../..')) # General configuration # --------------------- @@ -37,7 +36,7 @@ master_doc = 'index' # General substitutions. -import project +from postgresql import project copyright = '2010, ' + project.author # The default replacements for |version| and |release|, also used in various diff --git a/postgresql/documentation/sphinx/index.rst b/postgresql/documentation/sphinx/index.rst index 2ce60a55..d2d4c1e0 100644 --- a/postgresql/documentation/sphinx/index.rst +++ b/postgresql/documentation/sphinx/index.rst @@ -23,7 +23,6 @@ Contents lib clientparameters gotchas - changes Reference --------- @@ -32,6 +31,15 @@ Reference :maxdepth: 2 bin + modules + +Changes +------- + +.. toctree:: + :maxdepth: 1 + + changes-v1.0 Sample Code ----------- diff --git a/postgresql/documentation/sphinx/modules.rst b/postgresql/documentation/sphinx/modules.rst index 7b919a6e..133ce779 100644 --- a/postgresql/documentation/sphinx/modules.rst +++ b/postgresql/documentation/sphinx/modules.rst @@ -12,6 +12,15 @@ Modules intended for general use. .. autofunction:: open +:mod:`postgresql.sys` +--------------------- + +.. automodule:: + postgresql.sys + :members: + :show-inheritance: + + :mod:`postgresql.string` ------------------------ @@ -19,3 +28,66 @@ Modules intended for general use. postgresql.string :members: :show-inheritance: + + +:mod:`postgresql.exceptions` +---------------------------- + +.. automodule:: + postgresql.exceptions + :members: + :show-inheritance: + + +:mod:`postgresql.temporal` +-------------------------- + +.. automodule:: + postgresql.temporal + :members: + :show-inheritance: + + +:mod:`postgresql.installation` +------------------------------ + +.. automodule:: + postgresql.installation + :members: + :show-inheritance: + + +:mod:`postgresql.cluster` +------------------------- + +.. automodule:: + postgresql.cluster + :members: + :show-inheritance: + + +:mod:`postgresql.copyman` +------------------------- + +.. automodule:: + postgresql.copyman + :members: + :show-inheritance: + + +:mod:`postgresql.alock` +----------------------- + +.. automodule:: + postgresql.alock + :members: + :show-inheritance: + + +:mod:`postgresql.api` +--------------------- + +.. automodule:: + postgresql.api + :members: + :show-inheritance: diff --git a/postgresql/driver/pq3.py b/postgresql/driver/pq3.py index f3af0e8d..5114e49c 100644 --- a/postgresql/driver/pq3.py +++ b/postgresql/driver/pq3.py @@ -417,7 +417,7 @@ def record_io_factory(self, funpack = tuple(map(get1, column_io)) row_constructor = self.RowTypeFactory(attribute_map = attmap, composite_relid = composite_relid) - def raise_pack_tuple_error(procs, tup, itemnum): + def raise_pack_tuple_error(cause, procs, tup, itemnum): data = repr(tup[itemnum]) if len(data) > 80: # Be sure not to fill screen with noise. @@ -428,9 +428,9 @@ def raise_pack_tuple_error(procs, tup, itemnum): (b'M', fmt_errmsg('pack', itemnum, attnames[itemnum], typnames[itemnum], composite_name),), (b'W', data,), (b'P', str(itemnum),) - ))) + )), cause = cause) - def raise_unpack_tuple_error(procs, tup, itemnum): + def raise_unpack_tuple_error(cause, procs, tup, itemnum): data = repr(tup[itemnum]) if len(data) > 80: # Be sure not to fill screen with noise. @@ -441,7 +441,7 @@ def raise_unpack_tuple_error(procs, tup, itemnum): (b'M', fmt_errmsg('unpack', itemnum, attnames[itemnum], typnames[itemnum], composite_name),), (b'W', data,), (b'P', str(itemnum),), - ))) + )), cause = cause) def unpack_a_record(data, unpack = io_lib.record_unpack, @@ -528,7 +528,7 @@ def _decode_failsafe(self, data): # This should be sufficiently informative in most cases, # and in the cases where it isn't, an element traceback should # ultimately yield the pertinent information - yield (x[0], repr(data[1])[2:-1]) + yield (x[0], repr(x[1])[2:-1]) def decode_notice(self, notice): notice = self._decode_failsafe(notice.items()) @@ -618,10 +618,7 @@ def __init__(self, cursor_id, wref = weakref.ref, ID = ID): self._pq_cursor_id = self.database.typio.encode(cursor_id) # If the cursor's id was generated, it should be garbage collected. if cursor_id == ID(self): - garbage = self.database.pq.garbage_cursors.append - cid = self._pq_cursor_id - # Callback for closing the cursor on remote end. - self._del = wref(self, lambda x: garbage(cid)) + self.database.pq.register_cursor(self, self._pq_cursor_id) self._quoted_cursor_id = '"' + cursor_id.replace('"', '""') + '"' self._init() @@ -630,11 +627,8 @@ def __iter__(self): def close(self): if self.closed is False: - self.database.pq.garbage_cursors.append(self._pq_cursor_id) + self.database.pq.trash_cursor(self._pq_cursor_id) self.closed = True - # Don't need the weakref anymore. - if hasattr(self, '_del'): - del self._del def _ins(self, *args): return xact.Instruction(*args, asynchook = self.database._receive_async) @@ -731,12 +725,13 @@ def _process_tuple_chunk_Column(self, x, range = range): r = range(len(l)) try: return [unpack(l[i]) for i in r] - except: - try: - i = next(r) - except StopIteration: - i = len(l) - self._raise_column_tuple_error(self._output_io, (l[i],), 0) + except Exception: + cause = sys.exc_info()[1] + try: + i = next(r) + except StopIteration: + i = len(l) + self._raise_column_tuple_error(cause, self._output_io, (l[i],), 0) # Process the element.Tuple message in x for rows() def _process_tuple_chunk_Row(self, x, @@ -752,7 +747,7 @@ def _process_tuple_chunk_Row(self, x, def _process_tuple_chunk(self, x, proc = process_chunk): return proc(self._output_io, x, self._raise_column_tuple_error) - def _raise_column_tuple_error(self, procs, tup, itemnum): + def _raise_column_tuple_error(self, cause, procs, tup, itemnum): 'for column processing' # The element traceback will include the full list of parameters. data = repr(tup[itemnum]) @@ -775,7 +770,7 @@ def _raise_column_tuple_error(self, procs, tup, itemnum): (b'H', "Try casting the column to 'text'."), (b'P', str(itemnum)), )) - self.database.typio.raise_client_error(em, creator = self) + self.database.typio.raise_client_error(em, creator = self, cause = cause) @property def state(self): @@ -1279,10 +1274,8 @@ def __init__(self, self._pq_statement_id = database.typio._encode(self.statement_id)[0] if not statement_id: - garbage = database.pq.garbage_statements.append - sid = self._pq_statement_id - # Callback for closing the statement on remote end. - self._del = wref(self, lambda x: garbage(sid)) + # Register statement on a connection to close it automatically on db end + database.pq.register_statement(self, self._pq_statement_id) def __repr__(self): return '<{mod}.{name}[{ci}] {state}>'.format( @@ -1302,7 +1295,7 @@ def _pq_parameters(self, parameters, proc = process_tuple): # process_tuple failed(exception). The parameters could not be packed. # This function is called with the given information in the context # of the original exception(to allow chaining). - def _raise_parameter_tuple_error(self, procs, tup, itemnum): + def _raise_parameter_tuple_error(self, cause, procs, tup, itemnum): # Find the SQL type name. This should *not* hit the server. typ = self.database.typio.sql_type_from_oid( self.pg_parameter_types[itemnum] @@ -1325,11 +1318,11 @@ def _raise_parameter_tuple_error(self, procs, tup, itemnum): (b'H', "Try casting the parameter to 'text', then to the target type."), (b'P', str(itemnum)) )) - self.database.typio.raise_client_error(em, creator = self) + self.database.typio.raise_client_error(em, creator = self, cause = cause) ## # Similar to the parameter variant. - def _raise_column_tuple_error(self, procs, tup, itemnum): + def _raise_column_tuple_error(self, cause, procs, tup, itemnum): # Find the SQL type name. This should *not* hit the server. typ = self.database.typio.sql_type_from_oid( self.pg_column_types[itemnum] @@ -1352,7 +1345,7 @@ def _raise_column_tuple_error(self, procs, tup, itemnum): (b'H', "Try casting the column to 'text'."), (b'P', str(itemnum)), )) - self.database.typio.raise_client_error(em, creator = self) + self.database.typio.raise_client_error(em, creator = self, cause = cause) @property def state(self) -> str: @@ -1423,11 +1416,8 @@ def sql_parameter_types(self): def close(self): if self.closed is False: - self.database.pq.garbage_statements.append(self._pq_statement_id) + self.database.pq.trash_statement(self._pq_statement_id) self.closed = True - # Don't need the weakref anymore. - if hasattr(self, '_del'): - del self._del def _init(self): """ @@ -2042,14 +2032,19 @@ class Transaction(pg_api.Transaction): mode = None isolation = None + gid = None - _e_factors = ('database', 'isolation', 'mode') + _e_factors = ('database', 'gid', 'isolation', 'mode') def _e_metas(self): yield (None, self.state) - def __init__(self, database, isolation = None, mode = None): + def __init__(self, database, isolation = None, mode = None, gid = None): self.database = database + self.gid = gid + if gid is not None: + # XXX: remove in 1.1 + warnings.warn("two phase interfaces will not exist in 1.1; do not use the 'gid' parameter", DeprecationWarning, stacklevel=3) self.isolation = isolation self.mode = mode self.state = 'initialized' @@ -2080,10 +2075,26 @@ def __exit__(self, typ, value, tb): # If an error occurs, clean up the transaction state # and raise as needed. except pg_exc.ActiveTransactionError as err: - if not self.database.closed: + ## + # Failed COMMIT PREPARED ? + # Likely cases: + # - User exited block without preparing the transaction. + ## + if not self.database.closed and self.gid is not None: # adjust the state so rollback will do the right thing and abort. self.state = 'open' self.rollback() + ## + # The other exception that *can* occur is + # UndefinedObjectError in which: + # - User issued C/RB P before exit, but not via xact methods. + # - User adjusted gid after prepare(). + # + # But the occurrence of this exception means it's not in an active + # transaction, which means no cleanup other than raise is necessary. + err.details['cause'] = \ + "The prepared transaction was not " \ + "prepared prior to the block's exit." raise elif issubclass(typ, Exception): # There's an exception, so only rollback if the connection @@ -2129,7 +2140,7 @@ def start(self): ) else: self.type = 'savepoint' - if (self.isolation, self.mode) != (None,None): + if (self.gid, self.isolation, self.mode) != (None,None,None): em = element.ClientError(( (b'S', 'ERROR'), (b'C', '--OPE'), @@ -2142,15 +2153,60 @@ def start(self): self.state = 'open' begin = start + @staticmethod + def _prepare_string(id): + "2pc prepared transaction 'gid'" + return "PREPARE TRANSACTION '" + id.replace("'", "''") + "';" + @staticmethod def _release_string(id): 'release "";' return 'RELEASE "xact(' + id.replace('"', '""') + ')";' + def prepare(self): + if self.state == 'prepared': + return + if self.state != 'open': + em = element.ClientError(( + (b'S', 'ERROR'), + (b'C', '--OPE'), + (b'M', "transaction state must be 'open' in order to prepare"), + )) + self.database.typio.raise_client_error(em, creator = self) + if self.type != 'block': + em = element.ClientError(( + (b'S', 'ERROR'), + (b'C', '--OPE'), + (b'M', "improper transaction type to prepare"), + )) + self.database.typio.raise_client_error(em, creator = self) + q = self._prepare_string(self.gid) + self.database.execute(q) + self.state = 'prepared' + + def recover(self): + if self.state != 'initialized': + em = element.ClientError(( + (b'S', 'ERROR'), + (b'C', '--OPE'), + (b'M', "improper state for prepared transaction recovery"), + )) + self.database.typio.raise_client_error(em, creator = self) + if self.database.sys.xact_is_prepared(self.gid): + self.state = 'prepared' + self.type = 'block' + else: + em = element.ClientError(( + (b'S', 'ERROR'), + (b'C', '42704'), # UndefinedObjectError + (b'M', "prepared transaction does not exist"), + )) + self.database.typio.raise_client_error(em, creator = self) + def commit(self): if self.state == 'committed': return - if self.state != 'open': + if self.state not in ('prepared', 'open'): em = element.ClientError(( (b'S', 'ERROR'), (b'C', '--OPE'), @@ -2159,8 +2215,19 @@ def commit(self): self.database.typio.raise_client_error(em, creator = self) if self.type == 'block': - q = 'COMMIT' + if self.gid is not None: + # User better have prepared it. + q = "COMMIT PREPARED '" + self.gid.replace("'", "''") + "';" + else: + q = 'COMMIT' else: + if self.gid is not None: + em = element.ClientError(( + (b'S', 'ERROR'), + (b'C', '--OPE'), + (b'M', "savepoint configured with global identifier"), + )) + self.database.typio.raise_client_error(em, creator = self) q = self._release_string(hex(id(self))) self.database.execute(q) self.state = 'committed' @@ -2181,7 +2248,10 @@ def rollback(self): self.database.typio.raise_client_error(em, creator = self) if self.type == 'block': - q = 'ABORT;' + if self.state == 'prepared': + q = "ROLLBACK PREPARED '" + self.gid.replace("'", "''") + "'" + else: + q = 'ABORT;' elif self.type == 'savepoint': q = self._rollback_to_string(hex(id(self))) else: @@ -2263,8 +2333,8 @@ def do(self, language : str, source : str, sql = "DO " + qlit(source) + " LANGUAGE " + qid(language) + ";" self.execute(sql) - def xact(self, isolation = None, mode = None): - x = Transaction(self, isolation = isolation, mode = mode) + def xact(self, gid = None, isolation = None, mode = None): + x = Transaction(self, gid = gid, isolation = isolation, mode = mode) return x def prepare(self, @@ -2293,26 +2363,36 @@ def cursor_from_id(self, cursor_id : str) -> Cursor: @property def closed(self) -> bool: - if not hasattr(self, 'pq'): + if getattr(self, 'pq', None) is None: return True if hasattr(self.pq, 'socket') and self.pq.xact is not None: return self.pq.xact.fatal is True return False - def close(self): - if self.closed: - return + def close(self, getattr = getattr): # Write out the disconnect message if the socket is around. # If the connection is known to be lost, don't bother. It will # generate an extra exception. - x = self.pq.xact - if x: - # don't raise? + if getattr(self, 'pq', None) is None or getattr(self.pq, 'socket', None) is None: + # No action to take. + return + + x = getattr(self.pq, 'xact', None) + if x is not None and x.fatal is not True: + # finish the existing pq transaction iff it's not Closing. self.pq.complete() - if self.closed: - return - self.pq.push(xact.Closing()) - self.pq.complete() + + if self.pq.xact is None: + # It completed the existing transaction. + self.pq.push(xact.Closing()) + self.pq.complete() + if self.pq.socket: + self.pq.complete() + + # Close the socket if there is one. + if self.pq.socket: + self.pq.socket.close() + self.pq.socket = None @property def state(self) -> str: @@ -2347,13 +2427,22 @@ def connect(self): if self.closed is False: # already connected? just return. return - # It's closed. if hasattr(self, 'pq'): # It's closed, *but* there's a PQ connection.. x = self.pq.xact self.typio.raise_error(x.error_message, cause = getattr(x, 'exception', None), creator = self) + # It's closed. + try: + self._establish() + except Exception: + # Close it up on failure. + self.close() + raise + + def _establish(self): + # guts of connect() self.pq = None # if any exception occurs past this point, the connection # will not be usable. @@ -2431,7 +2520,13 @@ def connect(self): self._receive_async(x) # success! break + elif pq.socket is not None: + # In this case, an application/protocol error occurred. + # Close out the sockets ourselves. + pq.socket.close() + # Identify whether or not we can skip the attempt. + # Whether or not we can skip depends entirely on the SSL parameter. if sslmode == 'prefer' and ssl is False and didssl is False: # In this case, the server doesn't support SSL or it's # turned off. Therefore, the "without_ssl" attempt need @@ -2630,6 +2725,7 @@ def __init__(self, connector, *args, **kw): self.connector = connector # raw notify messages self._notifies = [] + self.fileno = -1 self.typio = self.connector.driver.typio(self) self.typio.set_encoding('ascii') self.settings = Settings(self) @@ -2758,41 +2854,49 @@ def socket_factory_sequence(self): to the target host. """ -class IP4(SocketConnector): - 'Connector for establishing IPv4 connections' - ipv = 4 + def create_socket_factory(self, **params): + return SocketFactory(**params) + +class IPConnector(SocketConnector): def socket_factory_sequence(self): return self._socketcreators - def __init__(self, - host : "IPv4 Address (str)" = None, - port : int = None, - ipv = 4, - **kw - ): + def socket_factory_params(self, host, port, ipv, **kw): if ipv != self.ipv: - raise TypeError("'ipv' keyword must be '4'") + raise TypeError("'ipv' keyword must be '%d'" % self.ipv) if host is None: raise TypeError("'host' is a required keyword and cannot be 'None'") if port is None: raise TypeError("'port' is a required keyword and cannot be 'None'") - self.host = host - self.port = int(port) + + return {'socket_create': (self.address_family, socket.SOCK_STREAM), + 'socket_connect': (host, int(port))} + + def __init__(self, host, port, ipv, **kw): + params = self.socket_factory_params(host, port, ipv, **kw) + self.host, self.port = params['socket_connect'] # constant socket connector - self._socketcreator = SocketFactory( - (socket.AF_INET, socket.SOCK_STREAM), - (self.host, self.port) - ) - self._socketcreators = ( - self._socketcreator, - ) + self._socketcreator = self.create_socket_factory(**params) + self._socketcreators = (self._socketcreator,) super().__init__(**kw) -class IP6(SocketConnector): +class IP4(IPConnector): + 'Connector for establishing IPv4 connections' + ipv = 4 + address_family = socket.AF_INET + + def __init__(self, + host : "IPv4 Address (str)" = None, + port : int = None, + ipv = 4, + **kw + ): + super().__init__(host, port, ipv, **kw) + +class IP6(IPConnector): 'Connector for establishing IPv6 connections' ipv = 6 - def socket_factory_sequence(self): - return self._socketcreators + address_family = socket.AF_INET6 def __init__(self, host : "IPv6 Address (str)" = None, @@ -2800,37 +2904,25 @@ def __init__(self, ipv = 6, **kw ): - if ipv != self.ipv: - raise TypeError("'ipv' keyword must be '6'") - if host is None: - raise TypeError("'host' is a required keyword and cannot be 'None'") - if port is None: - raise TypeError("'port' is a required keyword and cannot be 'None'") - self.host = host - self.port = int(port) - # constant socket connector - self._socketcreator = SocketFactory( - (socket.AF_INET6, socket.SOCK_STREAM), - (self.host, self.port) - ) - self._socketcreators = ( - self._socketcreator, - ) - super().__init__(**kw) + super().__init__(host, port, ipv, **kw) class Unix(SocketConnector): 'Connector for establishing unix domain socket connections' def socket_factory_sequence(self): return self._socketcreators - def __init__(self, unix = None, **kw): + def socket_factory_params(self, unix): if unix is None: raise TypeError("'unix' is a required keyword and cannot be 'None'") - self.unix = unix + + return {'socket_create': (socket.AF_UNIX, socket.SOCK_STREAM), + 'socket_connect': unix} + + def __init__(self, unix = None, **kw): + params = self.socket_factory_params(unix) + self.unix = params['socket_connect'] # constant socket connector - self._socketcreator = SocketFactory( - (socket.AF_UNIX, socket.SOCK_STREAM), self.unix - ) + self._socketcreator = self.create_socket_factory(**params) self._socketcreators = (self._socketcreator,) super().__init__(**kw) @@ -2847,12 +2939,18 @@ def socket_factory_sequence(self): """ return [ # (AF, socktype, proto), (IP, Port) - SocketFactory(x[0:3], x[4][:2], self._socket_secure) + self.create_socket_factory(**(self.socket_factory_params(x[0:3], x[4][:2], + self._socket_secure))) for x in socket.getaddrinfo( self.host, self.port, self._address_family, socket.SOCK_STREAM ) ] + def socket_factory_params(self, socktype, address, sslparams): + return {'socket_create': socktype, + 'socket_connect': address, + 'socket_secure': sslparams} + def __init__(self, host : str = None, port : (str, int) = None, diff --git a/postgresql/notifyman.py b/postgresql/notifyman.py index 4f6a3df0..b46aa0df 100644 --- a/postgresql/notifyman.py +++ b/postgresql/notifyman.py @@ -71,6 +71,11 @@ def _wait_on_wires(self, time = time, select = select): # Connections already marked as "bad" should not be checked. check = self.connections - self.garbage + for db in check: + if db.closed: + self.connections.remove(db) + self.garbage.add(db) + check = self.connections - self.garbage r, w, x = select(check, (), check, max_duration) # Make sure the connection's _notifies get filled. diff --git a/postgresql/port/optimized/functools.c b/postgresql/port/optimized/functools.c index 095a7b0c..45a5d75f 100644 --- a/postgresql/port/optimized/functools.c +++ b/postgresql/port/optimized/functools.c @@ -100,7 +100,6 @@ _process_tuple(PyObject *procs, PyObject *tup, PyObject *fail) * processed and therefore a generalized exception raised in the * context of the original is *very* useful. */ - Py_DECREF(rob); rob = NULL; @@ -109,26 +108,28 @@ _process_tuple(PyObject *procs, PyObject *tup, PyObject *fail) */ if (PyErr_ExceptionMatches(PyExc_Exception)) { - PyObject *failargs, *failedat; - PyObject *exc, *val, *tb; - PyObject *oldexc, *oldval, *oldtb; + PyObject *cause, *failargs, *failedat; + PyObject *exc, *tb; /* Store exception to set context after handler. */ - PyErr_Fetch(&oldexc, &oldval, &oldtb); - PyErr_NormalizeException(&oldexc, &oldval, &oldtb); + PyErr_Fetch(&exc, &cause, &tb); + PyErr_NormalizeException(&exc, &cause, &tb); + Py_XDECREF(exc); + Py_XDECREF(tb); failedat = PyLong_FromSsize_t(i); if (failedat != NULL) { - failargs = PyTuple_New(3); + failargs = PyTuple_New(4); if (failargs != NULL) { - /* args for the exception "handler" */ - PyTuple_SET_ITEM(failargs, 0, procs); + /* args for the exception "generalizer" */ + PyTuple_SET_ITEM(failargs, 0, cause); + PyTuple_SET_ITEM(failargs, 1, procs); Py_INCREF(procs); - PyTuple_SET_ITEM(failargs, 1, tup); + PyTuple_SET_ITEM(failargs, 2, tup); Py_INCREF(tup); - PyTuple_SET_ITEM(failargs, 2, failedat); + PyTuple_SET_ITEM(failargs, 3, failedat); r = PyObject_CallObject(fail, failargs); Py_DECREF(failargs); @@ -145,33 +146,6 @@ _process_tuple(PyObject *procs, PyObject *tup, PyObject *fail) Py_DECREF(failedat); } } - - PyErr_Fetch(&exc, &val, &tb); - PyErr_NormalizeException(&exc, &val, &tb); - - /* - * Reference BaseException here as the condition is merely - * *validating* that SetContext can be used. - */ - if (val != NULL && PyObject_IsInstance(val, PyExc_BaseException)) - { - /* Steals oldval reference */ - PyException_SetContext(val, oldval); - Py_XDECREF(oldexc); - Py_XDECREF(oldtb); - PyErr_Restore(exc, val, tb); - } - else - { - /* - * Fetch & NormalizeException failed somehow. - * Use the old exception... - */ - PyErr_Restore(oldexc, oldval, oldtb); - Py_XDECREF(exc); - Py_XDECREF(val); - Py_XDECREF(tb); - } } /* diff --git a/postgresql/project.py b/postgresql/project.py index d97169e8..4d9be755 100644 --- a/postgresql/project.py +++ b/postgresql/project.py @@ -10,7 +10,7 @@ description = 'Driver and tools library for PostgreSQL' # Set this to the target date when approaching a release. -date = None +date = "Thu Mar 2 20:00:00 CST 2012" tags = set(()) -version_info = (1, 1, 0) +version_info = (1, 0, 4) version = '.'.join(map(str, version_info)) + (date is None and 'dev' or '') diff --git a/postgresql/protocol/client3.py b/postgresql/protocol/client3.py index 67f34d11..b48d3a57 100644 --- a/postgresql/protocol/client3.py +++ b/postgresql/protocol/client3.py @@ -5,6 +5,7 @@ Protocol version 3.0 client and tools. """ import os +import weakref from .buffer import pq_message_stream from . import element3 as element from . import xact3 as xact @@ -155,60 +156,51 @@ def connect(self, ssl = None, timeout = None): )) return - try: - if ssl is not None: - # if ssl is True, ssl is *required* - # if ssl is False, ssl will be tried, but not required - # if ssl is None, no SSL negotiation will happen - self.ssl_negotiation = supported = self.negotiate_ssl() - - # b'S' or b'N' was *not* received. - if supported is None: - # probably not PQv3.. - self.socket.close() - self.xact.fatal = True - self.xact.error_message = not_pq_error - self.xact.state = xact.Complete - return + if ssl is not None: + # if ssl is True, ssl is *required* + # if ssl is False, ssl will be tried, but not required + # if ssl is None, no SSL negotiation will happen + self.ssl_negotiation = supported = self.negotiate_ssl() - # b'N' was received, but ssl is required. - if not supported and ssl is True: - # ssl is required.. - self.socket.close() - self.xact.fatal = True - self.xact.error_message = no_ssl_error - self.xact.state = xact.Complete - return + # b'S' or b'N' was *not* received. + if supported is None: + # probably not PQv3.. + self.xact.fatal = True + self.xact.error_message = not_pq_error + self.xact.state = xact.Complete + return - if supported: - # Make an SSL connection. - try: - self.socket = self.socket_factory.secure(self.socket) - except Exception as err: - # Any exception marks a failure. - self.socket.close() - self.xact.exception = err - self.xact.fatal = True - self.xact.state = xact.Complete - self.xact.error_message = ssl_failed_error - return - # time to negotiate - negxact = self.xact - self.complete() - if negxact.state is xact.Complete and negxact.fatal is None: - self.key = negxact.killinfo.key - self.backend_id = negxact.killinfo.pid - elif not hasattr(self.xact, 'error_message'): - # if it's not complete, something strange happened. - # make sure to clean up... - self.socket.close() + # b'N' was received, but ssl is required. + if not supported and ssl is True: + # ssl is required.. self.xact.fatal = True + self.xact.error_message = no_ssl_error self.xact.state = xact.Complete - self.xact.error_message = partial_connection_error - except: - if self.socket is not None: - self.socket.close() - raise + return + + if supported: + # Make an SSL connection. + try: + self.socket = self.socket_factory.secure(self.socket) + except Exception as err: + # Any exception marks a failure. + self.xact.exception = err + self.xact.fatal = True + self.xact.state = xact.Complete + self.xact.error_message = ssl_failed_error + return + # time to negotiate + negxact = self.xact + self.complete() + if negxact.state is xact.Complete and negxact.fatal is None: + self.key = negxact.killinfo.key + self.backend_id = negxact.killinfo.pid + elif not hasattr(self.xact, 'error_message'): + # if it's not complete, something strange happened. + # make sure to clean up... + self.xact.fatal = True + self.xact.state = xact.Complete + self.xact.error_message = partial_connection_error def negotiate_ssl(self) -> (bool, None): """ @@ -250,7 +242,6 @@ def read_into(self, Complete = xact.Complete): except self.socket_factory.fatal_exception as e: msg = self.socket_factory.fatal_exception_message(e) if msg is not None: - self.socket.close() XACT.state = Complete XACT.fatal = True XACT.exception = e @@ -268,7 +259,6 @@ def read_into(self, Complete = xact.Complete): ## # nothing read from a blocking socket? it's over. if self.read_data == b'': - self.socket.close() XACT.state = Complete XACT.fatal = True XACT.error_message = eof_error @@ -307,7 +297,6 @@ def send_message_data(self): msg = self.socket_factory.fatal_exception_message(e) if msg is not None: # it's fatal. - self.socket.close() self.xact.state = xact.Complete self.xact.fatal = True self.xact.exception = e @@ -485,6 +474,28 @@ def complete(self): # only remove the transaction if it's *not* fatal self.xact = None + def register_cursor(self, cursor, pq_cursor_id): + trash = self.trash_cursor + self.cursors[pq_cursor_id] = weakref.ref(cursor, lambda ref: trash(pq_cursor_id)) + + def trash_cursor(self, pq_cursor_id): + try: + del self.cursors[pq_cursor_id] + except KeyError: + pass + self.garbage_cursors.append(pq_cursor_id) + + def register_statement(self, statement, pq_statement_id): + trash = self.trash_statement + self.statements[pq_statement_id] = weakref.ref(statement, lambda ref: trash(pq_statement_id)) + + def trash_statement(self, pq_statement_id): + try: + del self.statements[pq_statement_id] + except KeyError: + pass + self.garbage_statements.append(pq_statement_id) + def __str__(self): if hasattr(self, 'ssl_negotiation'): if self.ssl_negotiation is True: @@ -513,6 +524,9 @@ def __init__(self, socket_factory, startup, password = b'',): element.Startup(startup), password ) + self.cursors = {} + self.statements = {} + self.garbage_statements = [] self.garbage_cursors = [] diff --git a/postgresql/python/contextlib.py b/postgresql/python/contextlib.py deleted file mode 100644 index d58443e3..00000000 --- a/postgresql/python/contextlib.py +++ /dev/null @@ -1,25 +0,0 @@ -## -# .python.contextlib -## -import sys - -class NoCM(object): - """ - CM that does nothing. Useful for parameterized CMs. - """ - __slots__ = () - - def __new__(typ): - return typ - - @staticmethod - def __enter__(): - pass - - @classmethod - def __context__(typ): - return typ - - @staticmethod - def __exit__(typ, val, tb): - pass diff --git a/postgresql/python/functools.py b/postgresql/python/functools.py index 3e432ef5..02cf71f9 100644 --- a/postgresql/python/functools.py +++ b/postgresql/python/functools.py @@ -1,6 +1,7 @@ ## # python.functools ## +import sys from .decorlib import method def rsetattr(attr, val, ob): @@ -33,7 +34,7 @@ def __call__(self, r): # C implementation of the tuple processors. from ..port.optimized import process_tuple, process_chunk except ImportError: - def process_tuple(procs, tup, exception_handler, len = len, tuple = tuple): + def process_tuple(procs, tup, exception_handler, len = len, tuple = tuple, cause = None): """ Call each item in `procs` with the corresponding item in `tup` returning the result as `type`. @@ -57,8 +58,10 @@ def process_tuple(procs, tup, exception_handler, len = len, tuple = tuple): continue r[i] = procs[i](ob) except Exception: - # relying on __context__ - exception_handler(procs, tup, i) + cause = sys.exc_info()[1] + + if cause is not None: + exception_handler(cause, procs, tup, i) raise RuntimeError("process_tuple exception handler failed to raise") return tuple(r) diff --git a/postgresql/release/distutils.py b/postgresql/release/distutils.py index 2f3ebd4e..d1d10c4f 100644 --- a/postgresql/release/distutils.py +++ b/postgresql/release/distutils.py @@ -13,7 +13,7 @@ import sys import os from ..project import version, name, identity as url -from distutils.core import Extension +from distutils.core import Extension, Command LONG_DESCRIPTION = """ py-postgresql is a set of Python modules providing interfaces to various parts @@ -172,7 +172,25 @@ def standard_setup_keywords(build_extensions = True, prefix = default_prefix): 'classifiers' : CLASSIFIERS, 'packages' : list(prefixed_packages(prefix = prefix)), 'package_data' : dict(prefixed_package_data(prefix = prefix)), + 'cmdclass': dict(test=TestCommand), } if build_extensions: d['ext_modules'] = list(prefixed_extensions(prefix = prefix)) return d + +class TestCommand(Command): + description = "run tests" + + # List of option tuples: long name, short name (None if no short + # name), and help string. + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import unittest + unittest.main(module='postgresql.test.testall', argv=('setup.py',)) diff --git a/postgresql/temporal.py b/postgresql/temporal.py index 0c427543..61c291f9 100644 --- a/postgresql/temporal.py +++ b/postgresql/temporal.py @@ -132,6 +132,7 @@ def init(self, log_destination = 'stderr', log_min_messages = 'FATAL', silent_mode = 'off', + unix_socket_directory = cluster.data_directory, )) cluster.settings.update(dict( max_prepared_transactions = '10', @@ -212,7 +213,7 @@ def pop(self, exc, drop_schema = 'DROP SCHEMA sandbox{0} CASCADE'.format): # interrupt before closing. It is still # possible for the close to block, but less likely. xdb.interrupt() - xdb.close() + xdb.close() # Interrupted and closed all the other connections at this level; # now remove the sandbox schema. diff --git a/postgresql/test/test_cluster.py b/postgresql/test/test_cluster.py index 29a0ef8a..302a53dc 100644 --- a/postgresql/test/test_cluster.py +++ b/postgresql/test/test_cluster.py @@ -34,6 +34,7 @@ def init(self, *args, **kw): 'listen_addresses' : 'localhost', 'port' : '6543', 'silent_mode' : 'off', + 'unix_socket_directory' : self.cluster.data_directory, }) def testSilentMode(self): diff --git a/postgresql/test/test_connect.py b/postgresql/test/test_connect.py index 2c2030c0..b64bf309 100644 --- a/postgresql/test/test_connect.py +++ b/postgresql/test/test_connect.py @@ -87,6 +87,7 @@ def configure_cluster(self): log_destination = 'stderr', log_min_messages = 'FATAL', silent_mode = 'off', + unix_socket_directory = self.cluster.data_directory, )) # 8.4 turns prepared transactions off by default. if self.cluster.installation.version_info >= (8,1): @@ -157,7 +158,6 @@ def configure_cluster(self): super().configure_cluster() self.cluster.settings.update({ 'log_min_messages' : 'log', - 'unix_socket_directory' : self.cluster.data_directory, }) # Configure the hba file with the supported methods. diff --git a/postgresql/test/test_driver.py b/postgresql/test/test_driver.py index 75471561..24f7eb9d 100644 --- a/postgresql/test/test_driver.py +++ b/postgresql/test/test_driver.py @@ -278,39 +278,50 @@ Varbit('010111101111'), ], ), -] - -if False: - # When an implementation does make it, - # re-enable these tests. - type_samples.append(( - 'inet', [ - IPAddress4('255.255.255.255'), - IPAddress4('127.0.0.1'), - IPAddress4('10.0.0.1'), - IPAddress4('0.0.0.0'), - IPAddress6('::1'), - IPAddress6('ffff' + ':ffff'*7), - IPAddress6('fe80::1'), - IPAddress6('fe80::1'), - IPAddress6('0::0'), + ('inet', [ + '255.255.255.255', + '127.0.0.1', + '10.0.0.1', + '0.0.0.0', + '::1', + 'ffff' + ':ffff'*7, + 'fe80::1', + 'fe80::1', + '::', # 0::0 + ], + ), + ('cidr', [ + '255.255.255.255/32', + '127.0.0.0/8', + '127.1.0.0/16', + '10.0.0.0/32', + '0.0.0.0/0', + 'ffff' + ':ffff'*7 + '/128', + '::1/128', + 'fe80::1/128', + 'fe80::/64', + 'fe80::/16', + '::/0', ], - )) - type_samples.append(( - 'cidr', [ - IPNetwork4('255.255.255.255/32'), - IPNetwork4('127.0.0.0/8'), - IPNetwork4('127.1.0.0/16'), - IPNetwork4('10.0.0.0/32'), - IPNetwork4('0.0.0.0/0'), - IPNetwork6('ffff' + ':ffff'*7 + '/128'), - IPNetwork6('::1/128'), - IPNetwork6('fe80::1/128'), - IPNetwork6('fe80::0/64'), - IPNetwork6('fe80::0/16'), - IPNetwork6('0::0/0'), + ), + ('inet[]', [ + ['127.0.0.1', '::1'], + ['10.0.0.1', 'fe80::1'], ], - )) + ), + ('cidr[]', [ + ['127.0.0.0/8', '::/0'], + ['10.0.0.0/16', 'fe80::/64'], + ['10.102.0.0/16', 'fe80::/64'], + ], + ), + ('macaddr[]', [ + ['00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff'], + ['00:00:00:00:00:01', '00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff'], + ['00:00:00:00:00:01', '00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff', '10:00:00:00:00:00'], + ], + ), +] class test_driver(unittest.TestCase): @pg_tmp @@ -1252,10 +1263,10 @@ def testTypeIOError(self): # 'foo' is not a valid Decimal. # Expecting a double TupleError here, one from the composite pack # and one from the row pack. - self.assertTrue(isinstance(err.__context__, pg_exc.CompositeError)) + self.assertTrue(isinstance(err.__cause__, pg_exc.CompositeError)) self.assertEqual(int(err.details['position']), 0) # attribute number that the failure occurred on - self.assertEqual(int(err.__context__.details['position']), 0) + self.assertEqual(int(err.__cause__.details['position']), 0) else: self.fail("failed to raise TupleError") @@ -1278,7 +1289,7 @@ def raise_ThisError(arg): try: ps(decimal.Decimal("101")) except pg_exc.ColumnError as err: - self.assertTrue(isinstance(err.__context__, ThisError)) + self.assertTrue(isinstance(err.__cause__, ThisError)) # might be too inquisitive.... self.assertEqual(int(err.details['position']), 0) self.assertTrue('NUMERIC' in err.message) @@ -1289,11 +1300,11 @@ def raise_ThisError(arg): try: ps((decimal.Decimal("101"),)) except pg_exc.ColumnError as err: - self.assertTrue(isinstance(err.__context__, pg_exc.CompositeError)) - self.assertTrue(isinstance(err.__context__.__context__, ThisError)) + self.assertTrue(isinstance(err.__cause__, pg_exc.CompositeError)) + self.assertTrue(isinstance(err.__cause__.__cause__, ThisError)) # might be too inquisitive.... self.assertEqual(int(err.details['position']), 0) - self.assertEqual(int(err.__context__.details['position']), 0) + self.assertEqual(int(err.__cause__.details['position']), 0) self.assertTrue('test_tuple_error' in err.message) else: self.fail("failed to raise TupleError from reception") @@ -1524,6 +1535,104 @@ def testCloseInSubTransactionBlock(self): except pg_exc.ConnectionDoesNotExistError: pass + @pg_tmp + def testPreparedTransactionCommit(self): + with db.xact(gid='commit_gid') as x: + db.execute("create table commit_gidtable as select 'foo'::text as t;") + x.prepare() + # not committed yet, so it better fail. + self.assertRaises(pg_exc.UndefinedTableError, + db.execute, "select * from commit_gidtable" + ) + # now it's committed. + self.assertEqual( + db.prepare("select * FROM commit_gidtable").first(), + 'foo', + ) + db.execute('drop table commit_gidtable;') + + @pg_tmp + def testWithUnpreparedTransaction(self): + try: + with db.xact(gid='not-gonna-prepare-it') as x: + pass + except pg_exc.ActiveTransactionError: + # *must* be okay to query again. + self.assertEqual(db.prepare('select 1').first(), 1) + else: + self.fail("commit with gid succeeded unprepared..") + + @pg_tmp + def testWithPreparedException(self): + class TheFailure(Exception): + pass + try: + with db.xact(gid='yeah,weprepare') as x: + x.prepare() + raise TheFailure() + except TheFailure as err: + # __exit__ should have issued ROLLBACK PREPARED, so let's find out. + # *must* be okay to query again. + self.assertEqual(db.prepare('select 1').first(), 1) + x = db.xact(gid='yeah,weprepare') + self.assertRaises(pg_exc.UndefinedObjectError, x.recover) + else: + self.fail("failure exception was not raised") + + @pg_tmp + def testUnPreparedTransactionCommit(self): + x = db.xact(gid='never_prepared') + x.start() + self.assertRaises(pg_exc.ActiveTransactionError, x.commit) + self.assertRaises(pg_exc.InFailedTransactionError, x.commit) + + @pg_tmp + def testPreparedTransactionRollback(self): + x = db.xact(gid='rollback_gid') + x.start() + db.execute("create table gidtable as select 'foo'::text as t;") + x.prepare() + x.rollback() + self.assertRaises( + pg_exc.UndefinedTableError, + db.execute, "select * from gidtable" + ) + + @pg_tmp + def testPreparedTransactionRecovery(self): + x = db.xact(gid='recover dis') + x.start() + db.execute("create table distable (i int);") + x.prepare() + del x + x = db.xact(gid='recover dis') + x.recover() + x.commit() + db.execute("drop table distable;") + + @pg_tmp + def testPreparedTransactionRecoveryAbort(self): + x = db.xact(gid='recover dis abort') + x.start() + db.execute("create table distableabort (i int);") + x.prepare() + del x + x = db.xact(gid='recover dis abort') + x.recover() + x.rollback() + self.assertRaises( + pg_exc.UndefinedTableError, + db.execute, "select * from distableabort" + ) + + @pg_tmp + def testPreparedTransactionFailedRecovery(self): + x = db.xact(gid="NO XACT HERE") + self.assertRaises( + pg_exc.UndefinedObjectError, + x.recover + ) + @pg_tmp def testSettingsCM(self): orig = db.settings['search_path'] @@ -1730,14 +1839,12 @@ def testBadFD(self): @pg_tmp def testAdminTerminated(self): - killer = new() - killer.sys.terminate_backends() - # hoping that this will guarantee that the terminate is complete - killer.close() + with new() as killer: + killer.sys.terminate_backends() self.assertRaises( pg_exc.AdminShutdownError, - sqlexec, "SELECT 1" + sqlexec, "SELECT 1", ) self.assertTrue(issubclass(pg_exc.AdminShutdownError, pg_exc.Disconnection)) diff --git a/postgresql/test/test_optimized.py b/postgresql/test/test_optimized.py index 72d64839..b2a5d4b1 100644 --- a/postgresql/test/test_optimized.py +++ b/postgresql/test/test_optimized.py @@ -28,36 +28,36 @@ class test_optimized(unittest.TestCase): def test_consume_tuple_messages(self): ctm = optimized.consume_tuple_messages # expecting a tuple of pairs. - self.failUnlessRaises(TypeError, ctm, []) - self.failUnlessEqual(ctm(()), []) + self.assertRaises(TypeError, ctm, []) + self.assertEqual(ctm(()), []) # Make sure that the slicing is working. - self.failUnlessEqual(ctm(tuplemessages), [ + self.assertEqual(ctm(tuplemessages), [ (b'foo', b'bar'), (b'foo', None, b'bar'), ]) # Not really checking consume here, but we are validating that # it's properly propagating exceptions. - self.failUnlessRaises(ValueError, ctm, ((b'D', b'\xff\xff\xff\xfefoo'),)) - self.failUnlessRaises(ValueError, ctm, ((b'D', b'\x00\x00\x00\x04foo'),)) + self.assertRaises(ValueError, ctm, ((b'D', b'\xff\xff\xff\xfefoo'),)) + self.assertRaises(ValueError, ctm, ((b'D', b'\x00\x00\x00\x04foo'),)) def test_parse_tuple_message(self): ptm = optimized.parse_tuple_message - self.failUnlessRaises(TypeError, ptm, "stringzor") - self.failUnlessRaises(TypeError, ptm, 123) - self.failUnlessRaises(ValueError, ptm, b'') - self.failUnlessRaises(ValueError, ptm, b'0') + self.assertRaises(TypeError, ptm, "stringzor") + self.assertRaises(TypeError, ptm, 123) + self.assertRaises(ValueError, ptm, b'') + self.assertRaises(ValueError, ptm, b'0') notenoughdata = struct.pack('!H', 2) - self.failUnlessRaises(ValueError, ptm, notenoughdata) + self.assertRaises(ValueError, ptm, notenoughdata) wraparound = struct.pack('!HL', 2, 10) + (b'0' * 10) + struct.pack('!L', 0xFFFFFFFE) - self.failUnlessRaises(ValueError, ptm, wraparound) + self.assertRaises(ValueError, ptm, wraparound) oneatt_notenough = struct.pack('!HL', 2, 10) + (b'0' * 10) + struct.pack('!L', 15) - self.failUnlessRaises(ValueError, ptm, oneatt_notenough) + self.assertRaises(ValueError, ptm, oneatt_notenough) toomuchdata = struct.pack('!HL', 1, 3) + (b'0' * 10) - self.failUnlessRaises(ValueError, ptm, toomuchdata) + self.assertRaises(ValueError, ptm, toomuchdata) class faketup(tuple): def __new__(subtype, geeze): @@ -66,31 +66,31 @@ def __new__(subtype, geeze): return r zerodata = struct.pack('!H', 0) r = ptm(zerodata) - self.failUnlessRaises(AttributeError, getattr, r, 'foo') - self.failUnlessRaises(AttributeError, setattr, r, 'foo', 'bar') - self.failUnlessEqual(len(r), 0) + self.assertRaises(AttributeError, getattr, r, 'foo') + self.assertRaises(AttributeError, setattr, r, 'foo', 'bar') + self.assertEqual(len(r), 0) def test_process_tuple(self): def funpass(procs, tup, col): pass pt = optimized.process_tuple # tuple() requirements - self.failUnlessRaises(TypeError, pt, "foo", "bar", funpass) - self.failUnlessRaises(TypeError, pt, (), "bar", funpass) - self.failUnlessRaises(TypeError, pt, "foo", (), funpass) - self.failUnlessRaises(TypeError, pt, (), ("foo",), funpass) + self.assertRaises(TypeError, pt, "foo", "bar", funpass) + self.assertRaises(TypeError, pt, (), "bar", funpass) + self.assertRaises(TypeError, pt, "foo", (), funpass) + self.assertRaises(TypeError, pt, (), ("foo",), funpass) def test_pack_tuple_data(self): pit = optimized.pack_tuple_data - self.failUnlessEqual(pit((None,)), b'\xff\xff\xff\xff') - self.failUnlessEqual(pit((None,)*2), b'\xff\xff\xff\xff'*2) - self.failUnlessEqual(pit((None,)*3), b'\xff\xff\xff\xff'*3) - self.failUnlessEqual(pit((None,b'foo')), b'\xff\xff\xff\xff\x00\x00\x00\x03foo') - self.failUnlessEqual(pit((None,b'')), b'\xff\xff\xff\xff\x00\x00\x00\x00') - self.failUnlessEqual(pit((None,b'',b'bar')), b'\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x03bar') - self.failUnlessRaises(TypeError, pit, 1) - self.failUnlessRaises(TypeError, pit, (1,)) - self.failUnlessRaises(TypeError, pit, ("",)) + self.assertEqual(pit((None,)), b'\xff\xff\xff\xff') + self.assertEqual(pit((None,)*2), b'\xff\xff\xff\xff'*2) + self.assertEqual(pit((None,)*3), b'\xff\xff\xff\xff'*3) + self.assertEqual(pit((None,b'foo')), b'\xff\xff\xff\xff\x00\x00\x00\x03foo') + self.assertEqual(pit((None,b'')), b'\xff\xff\xff\xff\x00\x00\x00\x00') + self.assertEqual(pit((None,b'',b'bar')), b'\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x03bar') + self.assertRaises(TypeError, pit, 1) + self.assertRaises(TypeError, pit, (1,)) + self.assertRaises(TypeError, pit, ("",)) def test_int2(self): d = b'\x00\x01' @@ -100,19 +100,19 @@ def test_int2(self): sd = optimized.swap_int2_pack(1) nd = optimized.int2_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(1, s) - self.failUnlessEqual(256, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(1, s) + self.assertEqual(256, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(1, n) - self.failUnlessEqual(256, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessRaises(OverflowError, optimized.swap_int2_pack, 2**15) - self.failUnlessRaises(OverflowError, optimized.int2_pack, 2**15) - self.failUnlessRaises(OverflowError, optimized.swap_int2_pack, (-2**15)-1) - self.failUnlessRaises(OverflowError, optimized.int2_pack, (-2**15)-1) + self.assertEqual(1, n) + self.assertEqual(256, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertRaises(OverflowError, optimized.swap_int2_pack, 2**15) + self.assertRaises(OverflowError, optimized.int2_pack, 2**15) + self.assertRaises(OverflowError, optimized.swap_int2_pack, (-2**15)-1) + self.assertRaises(OverflowError, optimized.int2_pack, (-2**15)-1) def test_int4(self): d = b'\x00\x00\x00\x01' @@ -122,19 +122,19 @@ def test_int4(self): sd = optimized.swap_int4_pack(1) nd = optimized.int4_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(1, s) - self.failUnlessEqual(16777216, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(1, s) + self.assertEqual(16777216, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(1, n) - self.failUnlessEqual(16777216, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessRaises(OverflowError, optimized.swap_int4_pack, 2**31) - self.failUnlessRaises(OverflowError, optimized.int4_pack, 2**31) - self.failUnlessRaises(OverflowError, optimized.swap_int4_pack, (-2**31)-1) - self.failUnlessRaises(OverflowError, optimized.int4_pack, (-2**31)-1) + self.assertEqual(1, n) + self.assertEqual(16777216, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertRaises(OverflowError, optimized.swap_int4_pack, 2**31) + self.assertRaises(OverflowError, optimized.int4_pack, 2**31) + self.assertRaises(OverflowError, optimized.swap_int4_pack, (-2**31)-1) + self.assertRaises(OverflowError, optimized.int4_pack, (-2**31)-1) def test_int8(self): d = b'\x00\x00\x00\x00\x00\x00\x00\x01' @@ -144,21 +144,21 @@ def test_int8(self): sd = optimized.swap_int8_pack(1) nd = optimized.int8_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(0x1, s) - self.failUnlessEqual(0x100000000000000, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(0x1, s) + self.assertEqual(0x100000000000000, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(0x1, n) - self.failUnlessEqual(0x100000000000000, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessEqual(optimized.swap_int8_pack(-1), b'\xFF\xFF\xFF\xFF'*2) - self.failUnlessEqual(optimized.int8_pack(-1), b'\xFF\xFF\xFF\xFF'*2) - self.failUnlessRaises(OverflowError, optimized.swap_int8_pack, 2**63) - self.failUnlessRaises(OverflowError, optimized.int8_pack, 2**63) - self.failUnlessRaises(OverflowError, optimized.swap_int8_pack, (-2**63)-1) - self.failUnlessRaises(OverflowError, optimized.int8_pack, (-2**63)-1) + self.assertEqual(0x1, n) + self.assertEqual(0x100000000000000, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertEqual(optimized.swap_int8_pack(-1), b'\xFF\xFF\xFF\xFF'*2) + self.assertEqual(optimized.int8_pack(-1), b'\xFF\xFF\xFF\xFF'*2) + self.assertRaises(OverflowError, optimized.swap_int8_pack, 2**63) + self.assertRaises(OverflowError, optimized.int8_pack, 2**63) + self.assertRaises(OverflowError, optimized.swap_int8_pack, (-2**63)-1) + self.assertRaises(OverflowError, optimized.int8_pack, (-2**63)-1) # edge I/O int8_max = ((2**63) - 1) int8_min = (-(2**63)) @@ -166,10 +166,10 @@ def test_int8(self): max = optimized.int8_pack(int8_max) swap_min = optimized.swap_int8_pack(int8_min) min = optimized.int8_pack(int8_min) - self.failUnlessEqual(optimized.swap_int8_unpack(swap_max), int8_max) - self.failUnlessEqual(optimized.int8_unpack(max), int8_max) - self.failUnlessEqual(optimized.swap_int8_unpack(swap_min), int8_min) - self.failUnlessEqual(optimized.int8_unpack(min), int8_min) + self.assertEqual(optimized.swap_int8_unpack(swap_max), int8_max) + self.assertEqual(optimized.int8_unpack(max), int8_max) + self.assertEqual(optimized.swap_int8_unpack(swap_min), int8_min) + self.assertEqual(optimized.int8_unpack(min), int8_min) def test_uint2(self): d = b'\x00\x01' @@ -179,21 +179,21 @@ def test_uint2(self): sd = optimized.swap_uint2_pack(1) nd = optimized.uint2_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(1, s) - self.failUnlessEqual(256, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(1, s) + self.assertEqual(256, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(1, n) - self.failUnlessEqual(256, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessRaises(OverflowError, optimized.swap_uint2_pack, -1) - self.failUnlessRaises(OverflowError, optimized.uint2_pack, -1) - self.failUnlessRaises(OverflowError, optimized.swap_uint2_pack, 2**16) - self.failUnlessRaises(OverflowError, optimized.uint2_pack, 2**16) - self.failUnlessEqual(optimized.uint2_pack(2**16-1), b'\xFF\xFF') - self.failUnlessEqual(optimized.swap_uint2_pack(2**16-1), b'\xFF\xFF') + self.assertEqual(1, n) + self.assertEqual(256, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertRaises(OverflowError, optimized.swap_uint2_pack, -1) + self.assertRaises(OverflowError, optimized.uint2_pack, -1) + self.assertRaises(OverflowError, optimized.swap_uint2_pack, 2**16) + self.assertRaises(OverflowError, optimized.uint2_pack, 2**16) + self.assertEqual(optimized.uint2_pack(2**16-1), b'\xFF\xFF') + self.assertEqual(optimized.swap_uint2_pack(2**16-1), b'\xFF\xFF') def test_uint4(self): d = b'\x00\x00\x00\x01' @@ -203,21 +203,21 @@ def test_uint4(self): sd = optimized.swap_uint4_pack(1) nd = optimized.uint4_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(1, s) - self.failUnlessEqual(16777216, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(1, s) + self.assertEqual(16777216, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(1, n) - self.failUnlessEqual(16777216, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessRaises(OverflowError, optimized.swap_uint4_pack, -1) - self.failUnlessRaises(OverflowError, optimized.uint4_pack, -1) - self.failUnlessRaises(OverflowError, optimized.swap_uint4_pack, 2**32) - self.failUnlessRaises(OverflowError, optimized.uint4_pack, 2**32) - self.failUnlessEqual(optimized.uint4_pack(2**32-1), b'\xFF\xFF\xFF\xFF') - self.failUnlessEqual(optimized.swap_uint4_pack(2**32-1), b'\xFF\xFF\xFF\xFF') + self.assertEqual(1, n) + self.assertEqual(16777216, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertRaises(OverflowError, optimized.swap_uint4_pack, -1) + self.assertRaises(OverflowError, optimized.uint4_pack, -1) + self.assertRaises(OverflowError, optimized.swap_uint4_pack, 2**32) + self.assertRaises(OverflowError, optimized.uint4_pack, 2**32) + self.assertEqual(optimized.uint4_pack(2**32-1), b'\xFF\xFF\xFF\xFF') + self.assertEqual(optimized.swap_uint4_pack(2**32-1), b'\xFF\xFF\xFF\xFF') def test_uint8(self): d = b'\x00\x00\x00\x00\x00\x00\x00\x01' @@ -227,21 +227,21 @@ def test_uint8(self): sd = optimized.swap_uint8_pack(1) nd = optimized.uint8_pack(1) if sys.byteorder == 'little': - self.failUnlessEqual(0x1, s) - self.failUnlessEqual(0x100000000000000, n) - self.failUnlessEqual(d, sd) - self.failUnlessEqual(rd, nd) + self.assertEqual(0x1, s) + self.assertEqual(0x100000000000000, n) + self.assertEqual(d, sd) + self.assertEqual(rd, nd) else: - self.failUnlessEqual(0x1, n) - self.failUnlessEqual(0x100000000000000, s) - self.failUnlessEqual(d, nd) - self.failUnlessEqual(rd, sd) - self.failUnlessRaises(OverflowError, optimized.swap_uint8_pack, -1) - self.failUnlessRaises(OverflowError, optimized.uint8_pack, -1) - self.failUnlessRaises(OverflowError, optimized.swap_uint8_pack, 2**64) - self.failUnlessRaises(OverflowError, optimized.uint8_pack, 2**64) - self.failUnlessEqual(optimized.uint8_pack((2**64)-1), b'\xFF\xFF\xFF\xFF'*2) - self.failUnlessEqual(optimized.swap_uint8_pack((2**64)-1), b'\xFF\xFF\xFF\xFF'*2) + self.assertEqual(0x1, n) + self.assertEqual(0x100000000000000, s) + self.assertEqual(d, nd) + self.assertEqual(rd, sd) + self.assertRaises(OverflowError, optimized.swap_uint8_pack, -1) + self.assertRaises(OverflowError, optimized.uint8_pack, -1) + self.assertRaises(OverflowError, optimized.swap_uint8_pack, 2**64) + self.assertRaises(OverflowError, optimized.uint8_pack, 2**64) + self.assertEqual(optimized.uint8_pack((2**64)-1), b'\xFF\xFF\xFF\xFF'*2) + self.assertEqual(optimized.swap_uint8_pack((2**64)-1), b'\xFF\xFF\xFF\xFF'*2) if __name__ == '__main__': from types import ModuleType diff --git a/postgresql/test/test_protocol.py b/postgresql/test/test_protocol.py index bd92513f..1a216477 100644 --- a/postgresql/test/test_protocol.py +++ b/postgresql/test/test_protocol.py @@ -101,7 +101,7 @@ def test_getvalue(self): b.write(nd) self.assertEqual(b.getvalue(), nd) b.write(packl(4)) - self.assertEqual(b.read(), [(b'N', b'')]) + self.assertEqual(list(b.read()), [(b'N', b'')]) self.assertEqual(b.getvalue(), b'') # partial; read one message to exercise # that the appropriate fragment of the first @@ -112,20 +112,20 @@ def test_getvalue(self): second = b'z' + packl(len(second_body) + 4) + second_body b.write(first + second) self.assertEqual(b.getvalue(), first + second) - self.assertEqual(b.read(1), [(b'v', first_body)]) + self.assertEqual(list(b.read(1)), [(b'v', first_body)]) self.assertEqual(b.getvalue(), second) - self.assertEqual(b.read(1), [(b'z', second_body)]) + self.assertEqual(list(b.read(1)), [(b'z', second_body)]) # now, with a third full message in the next chunk third_body = (b'9876' * 10) third = b'3' + packl(len(third_body) + 4) + third_body b.write(first + second) b.write(third) self.assertEqual(b.getvalue(), first + second + third) - self.assertEqual(b.read(1), [(b'v', first_body)]) + self.assertEqual(list(b.read(1)), [(b'v', first_body)]) self.assertEqual(b.getvalue(), second + third) - self.assertEqual(b.read(1), [(b'z', second_body)]) + self.assertEqual(list(b.read(1)), [(b'z', second_body)]) self.assertEqual(b.getvalue(), third) - self.assertEqual(b.read(1), [(b'3', third_body)]) + self.assertEqual(list(b.read(1)), [(b'3', third_body)]) self.assertEqual(b.getvalue(), b'') ## diff --git a/postgresql/test/test_python.py b/postgresql/test/test_python.py index fdd047fa..16d66cb7 100644 --- a/postgresql/test/test_python.py +++ b/postgresql/test/test_python.py @@ -11,7 +11,6 @@ from ..python.itertools import interlace from ..python.structlib import split_sized_data -from ..python.contextlib import * from ..python import functools from ..python import itertools from ..python.socket import find_available_port @@ -154,17 +153,6 @@ def testFindAvailable(self): finally: s.close() -class test_contextlib(unittest.TestCase): - def testNoCM(self): - with NoCM as foo: - pass - self.assertEqual(foo, None) - self.assertEqual(NoCM(), NoCM) - # has no state, may be used repeatedly - with NoCM as foo: - pass - self.assertEqual(foo, None) - def join_sized_data(*data, packL = struct.Struct("!L").pack, getlen = lambda x: len(x) if x is not None else 0xFFFFFFFF diff --git a/postgresql/test/test_types.py b/postgresql/test/test_types.py index 5399a53f..c552b9d4 100644 --- a/postgresql/test/test_types.py +++ b/postgresql/test/test_types.py @@ -235,7 +235,8 @@ def decode(x): (0xffffffff, 0), (0xffffffff // 2, 0xffff // 2), ], - +} +__ = { ('cidr', typlib.net_pack, typlib.net_unpack) : [ (0, 0, b"\x00\x00\x00\x00"), (2, 0, b"\x00" * 4), @@ -340,27 +341,27 @@ def testExpectIO(self, samples): ) class test_io(unittest.TestCase): - def test_process_tuple(self, pt = process_tuple): - def funpass(procs, tup, col): + def test_process_tuple(self): + def funpass(cause, procs, tup, col): pass - self.assertEqual(tuple(pt((),(), funpass)), ()) - self.assertEqual(tuple(pt((int,),("100",), funpass)), (100,)) - self.assertEqual(tuple(pt((int,int),("100","200"), funpass)), (100,200)) - self.assertEqual(tuple(pt((int,int),(None,"200"), funpass)), (None,200)) - self.assertEqual(tuple(pt((int,int,int),(None,None,"200"), funpass)), (None,None,200)) + self.assertEqual(tuple(process_tuple((),(), funpass)), ()) + self.assertEqual(tuple(process_tuple((int,),("100",), funpass)), (100,)) + self.assertEqual(tuple(process_tuple((int,int),("100","200"), funpass)), (100,200)) + self.assertEqual(tuple(process_tuple((int,int),(None,"200"), funpass)), (None,200)) + self.assertEqual(tuple(process_tuple((int,int,int),(None,None,"200"), funpass)), (None,None,200)) # The exception handler must raise. - self.assertRaises(RuntimeError, pt, (int,), ("foo",), funpass) + self.assertRaises(RuntimeError, process_tuple, (int,), ("foo",), funpass) class ThisError(Exception): pass data = [] - def funraise(procs, tup, col): + def funraise(cause, procs, tup, col): data.append((procs, tup, col)) - raise ThisError - self.assertRaises(ThisError, pt, (int,), ("foo",), funraise) + raise ThisError from cause + self.assertRaises(ThisError, process_tuple, (int,), ("foo",), funraise) self.assertEqual(data[0], ((int,), ("foo",), 0)) del data[0] - self.assertRaises(ThisError, pt, (int,int), ("100","bar"), funraise) + self.assertRaises(ThisError, process_tuple, (int,int), ("100","bar"), funraise) self.assertEqual(data[0], ((int,int), ("100","bar"), 1)) def testExpectations(self): diff --git a/postgresql/types/__init__.py b/postgresql/types/__init__.py index 2845d3ae..99877308 100644 --- a/postgresql/types/__init__.py +++ b/postgresql/types/__init__.py @@ -392,6 +392,9 @@ def __new__(typ, nested_elements): return nested_elements return typ.from_nest(list(nested_elements)) + def __getnewargs__(self): + return (self.nest(),) + def elements(self): """ Returns an iterator to the elements of the Array. The elements are diff --git a/postgresql/types/io/__init__.py b/postgresql/types/io/__init__.py index f175ff25..4442b771 100644 --- a/postgresql/types/io/__init__.py +++ b/postgresql/types/io/__init__.py @@ -37,7 +37,13 @@ pg_types.VARBITOID, ), - 'pg_system': ( + 'pg_network': ( + pg_types.MACADDROID, + pg_types.INETOID, + pg_types.CIDROID, + ), + + 'pg_system': ( pg_types.OIDOID, pg_types.XIDOID, pg_types.CIDOID, diff --git a/postgresql/types/io/lib.py b/postgresql/types/io/lib.py index 3a5b44be..1bccacb3 100644 --- a/postgresql/types/io/lib.py +++ b/postgresql/types/io/lib.py @@ -94,7 +94,7 @@ def mktime64(seconds_ms): time_pack = compose((mktime, double_pack)) time_unpack = compose((double_unpack, mktimetuple)) -def interval_pack(m_d_timetup, mktime = mktime): +def interval_pack(m_d_timetup, mktime = mktime, dll_pack = dll_pack): """ Given a triple, (month, day, (seconds, microseconds)), serialize it for transport. @@ -269,30 +269,145 @@ def varbit_unpack(data, long_unpack = long_unpack): """ return long_unpack(data[0:4]), data[4:] -def net_pack(family_mask_data, len = len): +from socket import \ +AF_INET, AF_INET6, \ +inet_pton, inet_ntop +from socket import error as socket_error +# From PGSQL src/include/utils/inet.h +_PGSQL_AF_INET = AF_INET +_PGSQL_AF_INET6 = AF_INET + 1 + +def net_pack(inet, len = len): """ - Given a triple, yield the serialized form for transport. + Given a string inet/cidr, yield the serialized form for transport. Prepends the ``family``, ``mask`` and implicit ``is_cidr`` fields. Supports cidr and inet types. """ - (family, mask, data) = family_mask_data - return bytes((family, mask, 1, len(data))) + data - -def net_unpack(data): - """ - Given serialized cidr data, return a tuple: - - (family, mask, data) + slash_index = inet.find('/') + mask = None + if slash_index >= 0: + try: + mask = int(inet[slash_index+1:]) + except ValueError: + raise ValueError('invalid mask in inet/cidr') + address = inet[:slash_index] + else: + address = inet + if inet.find(':') >= 0: + family = _PGSQL_AF_INET6 + posix_family = AF_INET6 + max_mask = 128 + else: + family = _PGSQL_AF_INET + posix_family = AF_INET + max_mask = 32 + #If IPv4 address is short, right pad it so that it is valid + num_bytes = len(address.split('.')) + if num_bytes < 4: + address += (4 - num_bytes) * '.0' + try: + data = inet_pton(posix_family, address) + except socket_error as exc: + raise ValueError(str(exc)) from exc + if mask is not None: + if not (0 <= mask <= max_mask): + raise ValueError('invalid mask in inet/cidr') + # Calculate optional cidr byte - PGSQL ignores this on input + i_address = int.from_bytes(data, byteorder='big', signed=False) + i_mask = ~(2**(max_mask-mask)-1) + i_net = i_address & i_mask + is_cidr = 1 if (i_net == i_address) else 0 + else: + is_cidr = 0 + mask = max_mask + return bytes((family, mask, is_cidr, len(data))) + data + +def net_unpack(data, cidr=False, len=len): + """ + Given serialized cidr data, return : + + Python string cidr/network representation """ family, mask, is_cidr, size = data[:4] + if family == _PGSQL_AF_INET: + posix_family = AF_INET + max_mask = 32 + proper_size = 4 + elif family == _PGSQL_AF_INET6: + posix_family = AF_INET6 + max_mask = 128 + proper_size = 16 + else: + raise ValueError("invalid family parameter") rd = data[4:] - if len(rd) != size: + rd_len = len(rd) + if rd_len != size and rd_len != proper_size: raise ValueError("invalid size parameter") - - return (family, mask, rd) + try: + address = inet_ntop(posix_family, rd) + except socket_error as exc: + raise ValueError(str(exc)) from exc + if not (0 <= mask <= max_mask): + raise ValueError("invalid mask parameter") + if cidr or (mask and mask != max_mask): + result = address + '/' + str(mask) + else: + result = address + return result + +def cidr_unpack(data): + """ + Variant of above for CIDR + """ + return net_unpack(data, cidr=True) + +def macaddr_pack(data): + """ + Pack a MAC address + + Format found in PGSQL src/backend/utils/adt/mac.c, and PGSQL Manual types + """ + # Accept all possible PGSQL Macaddr formats as in manual + # Oh for sscanf() as we could just copy PGSQL C in src/util/adt/mac.c + colon_parts = data.split(':') + dash_parts = data.split('-') + dot_parts = data.split('.') + if len(colon_parts) == 6: + mac_parts = colon_parts + elif len(dash_parts) == 6: + mac_parts = dash_parts + elif len(colon_parts) == 2: + mac_parts = [colon_parts[0][:2], colon_parts[0][2:4], colon_parts[0][4:], + colon_parts[1][:2], colon_parts[1][2:4], colon_parts[1][4:]] + elif len(dash_parts) == 2: + mac_parts = [dash_parts[0][:2], dash_parts[0][2:4], dash_parts[0][4:], + dash_parts[1][:2], dash_parts[1][2:4], dash_parts[1][4:]] + elif len(dot_parts) == 3: + mac_parts = [dot_parts[0][:2], dot_parts[0][2:], dot_parts[1][:2], + dot_parts[1][2:], dot_parts[2][:2], dot_parts[2][2:]] + elif len(colon_parts) == 1: + mac_parts = [data[:2], data[2:4], data[4:6], data[6:8], data[8:10], data[10:]] + else: + raise ValueError('data string cannot be parsed to bytes') + if len(mac_parts) != 6 and len(mac_parts[-1]) != 2: + raise ValueError('data string cannot be parsed to bytes') + macaddr = bytearray([int(p, 16) for p in mac_parts]) + return bytes(macaddr) + +def macaddr_unpack(data): + """ + Unpack a MAC address + + Format found in PGSQL src/backend/utils/adt/mac.c + """ + # This is easy, just go for standard macaddr format, + # just like PGSQL in src/util/adt/mac.c macaddr_out() + if len(data) != 6: + raise ValueError('macaddr has incorrect length') + return ("%02x:%02x:%02x:%02x:%02x:%02x" % tuple(data)) def record_unpack(data, long_unpack = long_unpack, diff --git a/postgresql/types/io/pg_network.py b/postgresql/types/io/pg_network.py index 00a6687c..806ed557 100644 --- a/postgresql/types/io/pg_network.py +++ b/postgresql/types/io/pg_network.py @@ -1,11 +1,14 @@ from .. import INETOID, CIDROID, MACADDROID from . import lib -#INETOID : (lib.net_pack, lib.net_unpack), -#CIDROID : (lib.net_pack, lib.net_unpack), - oid_to_io = { - MACADDROID : (None, None), - CIDROID : (None, None), - INETOID : (None, None), + MACADDROID : (lib.macaddr_pack, lib.macaddr_unpack, str), + CIDROID : (lib.net_pack, lib.cidr_unpack, str), + INETOID : (lib.net_pack, lib.net_unpack, str), +} + +oid_to_type = { + MACADDROID : str, + CIDROID : str, + INETOID : str, }