-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmodules.html
More file actions
2150 lines (1926 loc) · 158 KB
/
Copy pathmodules.html
File metadata and controls
2150 lines (1926 loc) · 158 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modules — py-postgresql 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '1.0.3',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="py-postgresql 1.0.3 documentation" href="index.html" />
<link rel="prev" title="Commands" href="bin.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="bin.html" title="Commands"
accesskey="P">previous</a> |</li>
<li><a href="index.html">py-postgresql 1.0.3 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="modules">
<h1>Modules<a class="headerlink" href="#modules" title="Permalink to this headline">¶</a></h1>
<p>Modules intended for general use.</p>
<div class="section" id="module-postgresql">
<span id="postgresql"></span><h2><a class="reference internal" href="#module-postgresql" title="postgresql"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql</span></tt></a><a class="headerlink" href="#module-postgresql" title="Permalink to this headline">¶</a></h2>
<p>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.</p>
<p>If it’s not documented in the narratives, <cite>postgresql.documentation.index</cite>, then
the stability of the APIs should <em>not</em> be trusted.</p>
<p>See <<a class="reference external" href="http://postgresql.org">http://postgresql.org</a>> for more information about PostgreSQL.</p>
<dl class="data">
<dt id="postgresql.version">
<tt class="descclassname">postgresql.</tt><tt class="descname">version</tt><em class="property"> = '1.0.3'</em><a class="headerlink" href="#postgresql.version" title="Permalink to this definition">¶</a></dt>
<dd><p>The version string of py-postgresql.</p>
</dd></dl>
<dl class="data">
<dt id="postgresql.version_info">
<tt class="descclassname">postgresql.</tt><tt class="descname">version_info</tt><em class="property"> = (1, 0, 3)</em><a class="headerlink" href="#postgresql.version_info" title="Permalink to this definition">¶</a></dt>
<dd><p>The version triple of py-postgresql: (major, minor, patch).</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.open">
<tt class="descclassname">postgresql.</tt><tt class="descname">open</tt><big>(</big><em>iri=None</em>, <em>prompt_title=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.open" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <cite>postgresql.api.Connection</cite> to the server referenced by the given
<cite>iri</cite>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">postgresql</span>
<span class="go"># General Format:</span>
<span class="gp">>>> </span><span class="n">db</span> <span class="o">=</span> <span class="n">postgresql</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">'pq://user:password@host:port/database'</span><span class="p">)</span>
<span class="go"># Connect to 'postgres' at localhost.</span>
<span class="gp">>>> </span><span class="n">db</span> <span class="o">=</span> <span class="n">postgresql</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">'localhost/postgres'</span><span class="p">)</span>
</pre></div>
</div>
<p>Connection keywords can also be used with <cite>open</cite>. See the narratives for
more information.</p>
<p>The <cite>prompt_title</cite> keyword is ignored. <cite>open</cite> will never prompt for
the password unless it is explicitly instructed to do so.</p>
<p>(Note: “pq” is the name of the protocol used to communicate with PostgreSQL)</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.sys">
<span id="postgresql-sys"></span><h2><a class="reference internal" href="#module-postgresql.sys" title="postgresql.sys"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.sys</span></tt></a><a class="headerlink" href="#module-postgresql.sys" title="Permalink to this headline">¶</a></h2>
<p>py-postgresql system functions and data.</p>
<div class="section" id="data">
<h3>Data<a class="headerlink" href="#data" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">libpath</span></tt></dt>
<dd>The local file system paths that contain query libraries.</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="overridable-functions">
<h3>Overridable Functions<a class="headerlink" href="#overridable-functions" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><dl class="docutils">
<dt>excformat</dt>
<dd>Information that makes up an exception’s displayed “body”.
Effectively, the implementation of <cite>postgresql.exception.Error.__str__</cite></dd>
<dt>msghook</dt>
<dd>Display a message.</dd>
</dl>
</div></blockquote>
<dl class="function">
<dt id="postgresql.sys.default_errformat">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">default_errformat</tt><big>(</big><em>val</em><big>)</big><a class="headerlink" href="#postgresql.sys.default_errformat" title="Permalink to this definition">¶</a></dt>
<dd><p>Built-in error formatter. DON’T TOUCH!</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.sys.default_msghook">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">default_msghook</tt><big>(</big><em>msg</em>, <em>format_message=<function format_element at 0x1025bd270></em><big>)</big><a class="headerlink" href="#postgresql.sys.default_msghook" title="Permalink to this definition">¶</a></dt>
<dd><p>Built-in message hook. DON’T TOUCH!</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.sys.errformat">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">errformat</tt><big>(</big><em>*args</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.sys.errformat" title="Permalink to this definition">¶</a></dt>
<dd><p>Raised Database Error formatter pointing to default_excformat.</p>
<p>Override if you like. All postgresql.exceptions.Error’s are formatted using
this function.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.sys.msghook">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">msghook</tt><big>(</big><em>*args</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.sys.msghook" title="Permalink to this definition">¶</a></dt>
<dd><p>Message hook pointing to default_msghook.</p>
<p>Override if you like. All untrapped messages raised by
driver connections come here to be printed to stderr.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.sys.reset_errformat">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">reset_errformat</tt><big>(</big><em>with_func=<function errformat at 0x1025b9050></em><big>)</big><a class="headerlink" href="#postgresql.sys.reset_errformat" title="Permalink to this definition">¶</a></dt>
<dd><p>restore the original excformat function</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.sys.reset_msghook">
<tt class="descclassname">postgresql.sys.</tt><tt class="descname">reset_msghook</tt><big>(</big><em>with_func=<function msghook at 0x1025b9160></em><big>)</big><a class="headerlink" href="#postgresql.sys.reset_msghook" title="Permalink to this definition">¶</a></dt>
<dd><p>restore the original msghook function</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-postgresql.string">
<span id="postgresql-string"></span><h2><a class="reference internal" href="#module-postgresql.string" title="postgresql.string"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.string</span></tt></a><a class="headerlink" href="#module-postgresql.string" title="Permalink to this headline">¶</a></h2>
<p>String split and join operations for dealing with literals and identifiers.</p>
<p>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.</p>
<p>All functions deal with strict quoting rules.</p>
<dl class="function">
<dt id="postgresql.string.escape_ident">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">escape_ident</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.escape_ident" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace every instance of ” with “”</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.escape_literal">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">escape_literal</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.escape_literal" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace every instance of ‘ with ‘’</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.qname">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">qname</tt><big>(</big><em>*args</em><big>)</big><a class="headerlink" href="#postgresql.string.qname" title="Permalink to this definition">¶</a></dt>
<dd><p>Quote the identifiers and join them using ‘.’</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.quote_ident">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">quote_ident</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.quote_ident" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace every instance of ‘ with <em>and</em> place ‘ on each end</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.quote_ident_if_needed">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">quote_ident_if_needed</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.quote_ident_if_needed" title="Permalink to this definition">¶</a></dt>
<dd><p>If needed, replace every instance of ‘”’ with ‘”“’ <em>and</em> place ‘”’ on each end.
Otherwise, just return the text.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.quote_literal">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">quote_literal</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.quote_literal" title="Permalink to this definition">¶</a></dt>
<dd><p>Escape the literal and wrap it in [single] quotations</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#postgresql.string.split" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
<p>Unquoted portions are regular strings, whereas quoted portions are
pair-tuples specifying the quotation mechanism and the content thereof.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">split</span><span class="p">(</span><span class="s">"select $$foobar$$"</span><span class="p">))</span>
<span class="go">['select ', ('$$', 'foobar'), '']</span>
</pre></div>
</div>
<p>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.</p>
<p>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.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split_ident">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split_ident</tt><big>(</big><em>text</em>, <em>sep='</em>, <em>'</em>, <em>quote='"'</em>, <em>maxsplit=-1</em><big>)</big><a class="headerlink" href="#postgresql.string.split_ident" title="Permalink to this definition">¶</a></dt>
<dd><p>Split a series of identifiers using the specified separator.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split_qname">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split_qname</tt><big>(</big><em>text</em>, <em>maxsplit=-1</em><big>)</big><a class="headerlink" href="#postgresql.string.split_qname" title="Permalink to this definition">¶</a></dt>
<dd><p>Call to .split_ident() with a ‘.’ sep parameter.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split_sql">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split_sql</tt><big>(</big><em>sql</em>, <em>sep=';'</em><big>)</big><a class="headerlink" href="#postgresql.string.split_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">split_sql</span><span class="p">(</span><span class="s">'select $$1$$ AS "foo;"; select 2;'</span><span class="p">))</span>
<span class="go">[['select ', ('$$', '1'), ' AS ', ('"', 'foo;'), ''], (' select 2',), ['']]</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split_sql_str">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split_sql_str</tt><big>(</big><em>sql</em>, <em>sep=';'</em><big>)</big><a class="headerlink" href="#postgresql.string.split_sql_str" title="Permalink to this definition">¶</a></dt>
<dd><p>Identical to split_sql but yields unsplit text.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">split_sql_str</span><span class="p">(</span><span class="s">'select $$1$$ AS "foo;"; select 2;'</span><span class="p">))</span>
<span class="go">['select $$1$$ AS "foo;"', ' select 2', '']</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.split_using">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">split_using</tt><big>(</big><em>text</em>, <em>quote</em>, <em>sep='.'</em>, <em>maxsplit=-1</em><big>)</big><a class="headerlink" href="#postgresql.string.split_using" title="Permalink to this definition">¶</a></dt>
<dd><p>split the string on the seperator ignoring the separator in quoted areas.</p>
<p>This is only useful for simple quoted strings. Dollar quotes, and backslash
escapes are not supported.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.string.unsplit">
<tt class="descclassname">postgresql.string.</tt><tt class="descname">unsplit</tt><big>(</big><em>splitted_iter</em><big>)</big><a class="headerlink" href="#postgresql.string.unsplit" title="Permalink to this definition">¶</a></dt>
<dd><p>catenate a split string. This is needed to handle the special
cases created by pg.string.split(). (Run-away quotations, primarily)</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.exceptions">
<span id="postgresql-exceptions"></span><h2><a class="reference internal" href="#module-postgresql.exceptions" title="postgresql.exceptions"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.exceptions</span></tt></a><a class="headerlink" href="#module-postgresql.exceptions" title="Permalink to this headline">¶</a></h2>
<p>PostgreSQL exceptions and warnings with associated state codes.</p>
<p>The primary entry points of this module is the <cite>ErrorLookup</cite> function and the
<cite>WarningLookup</cite> function. Given an SQL state code, they give back the most
appropriate Error or Warning subclass.</p>
<dl class="docutils">
<dt>For more information on error codes see:</dt>
<dd><a class="reference external" href="http://www.postgresql.org/docs/current/static/errcodes-appendix.html">http://www.postgresql.org/docs/current/static/errcodes-appendix.html</a></dd>
</dl>
<p>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:</p>
<div class="highlight-python"><pre>$ python -m postgresql.exceptions XX000
postgresql.exceptions.InternalError [XX000]</pre>
</div>
<p>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):</p>
<div class="highlight-python"><pre>$ python -m postgresql.exceptions XX400
postgresql.exceptions.InternalError [XX000]</pre>
</div>
<p>If that fails, it will return <cite>postgresql.exceptions.Error</cite></p>
<dl class="exception">
<dt id="postgresql.exceptions.AuthenticationMethodError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">AuthenticationMethodError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.AuthenticationMethodError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.DriverError" title="postgresql.exceptions.DriverError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverError</span></tt></a>, <a class="reference internal" href="#postgresql.exceptions.Disconnection" title="postgresql.exceptions.Disconnection"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Disconnection</span></tt></a></p>
<p>Server requested an authentication method that is not supported by the
driver.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.CFError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">CFError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.CFError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Configuration File Error</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.CardinalityError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">CardinalityError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.CardinalityError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Wrong number of rows returned</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ClientCannotConnectError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ClientCannotConnectError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ClientCannotConnectError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ConnectionError</span></tt></p>
<p>Client was unable to establish a connection to the server.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ConnectTimeoutError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ConnectTimeoutError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ConnectTimeoutError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.DriverError" title="postgresql.exceptions.DriverError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverError</span></tt></a>, <a class="reference internal" href="#postgresql.exceptions.Disconnection" title="postgresql.exceptions.Disconnection"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Disconnection</span></tt></a></p>
<p>Client was unable to esablish a connection in the given time</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ConnectionDoesNotExistError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ConnectionDoesNotExistError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ConnectionDoesNotExistError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ConnectionError</span></tt></p>
<p>The connection is closed or was never connected.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ConnectionFailureError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ConnectionFailureError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ConnectionFailureError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ConnectionError</span></tt></p>
<p>Raised when a connection is dropped</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.DPDSEError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">DPDSEError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.DPDSEError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Dependent Privilege Descriptors Still Exist</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.Disconnection">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">Disconnection</tt><a class="headerlink" href="#postgresql.exceptions.Disconnection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Exception" title="postgresql.exceptions.Exception"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Exception</span></tt></a></p>
<p>Exception identifying errors that result in disconnection</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.DriverError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">DriverError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.DriverError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Errors originating in the driver’s implementation.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.EREError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">EREError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.EREError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>External Routine Exception</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ERIEError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ERIEError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ERIEError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>External Routine Invocation Exception</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.Error">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">Error</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.message.Message</span></tt>, <a class="reference internal" href="#postgresql.exceptions.Exception" title="postgresql.exceptions.Exception"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Exception</span></tt></a></p>
<p>A PostgreSQL Error</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.EscapeCharacterError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">EscapeCharacterError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.EscapeCharacterError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DataError</span></tt></p>
<p>Invalid escape character</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.Exception">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">Exception</tt><a class="headerlink" href="#postgresql.exceptions.Exception" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.Exception</span></tt></p>
<p>Base PostgreSQL exception class</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.FeatureError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">FeatureError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.FeatureError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Unsupported feature</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ICVError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ICVError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ICVError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Integrity Contraint Violation</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.IRError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">IRError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.IRError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Insufficient Resource Error</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ITSError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ITSError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ITSError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.TransactionError</span></tt></p>
<p>Invalid Transaction State</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.exceptions.IgnoredClientParameterWarning">
<em class="property">class </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">IgnoredClientParameterWarning</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.IgnoredClientParameterWarning" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverWarning</span></tt></p>
<p>Warn the user of a valid, but ignored parameter.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.InFailedTransactionError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">InFailedTransactionError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.InFailedTransactionError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.ITSError" title="postgresql.exceptions.ITSError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ITSError</span></tt></a></p>
<p>Occurs when an action occurs in a failed transaction.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.InconsistentCursorIsolationError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">InconsistentCursorIsolationError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.InconsistentCursorIsolationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.ITSError" title="postgresql.exceptions.ITSError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ITSError</span></tt></a></p>
<p>The held cursor requires the same isolation.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.InsecurityError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">InsecurityError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.InsecurityError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.DriverError" title="postgresql.exceptions.DriverError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverError</span></tt></a>, <a class="reference internal" href="#postgresql.exceptions.Disconnection" title="postgresql.exceptions.Disconnection"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Disconnection</span></tt></a></p>
<p>Error signifying a secure channel to a server cannot be established.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.LoadError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">LoadError</tt><a class="headerlink" href="#postgresql.exceptions.LoadError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Exception" title="postgresql.exceptions.Exception"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Exception</span></tt></a></p>
<p>Failed to load a library</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.OIError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">OIError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.OIError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Operator Intervention</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ONIPSError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ONIPSError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ONIPSError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Object Not In Prerequisite State</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.OperationError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">OperationError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.OperationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.DriverError" title="postgresql.exceptions.DriverError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverError</span></tt></a></p>
<p>An invalid operation on an interface element.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.PLEError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">PLEError</tt><a class="headerlink" href="#postgresql.exceptions.PLEError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.OverflowError</span></tt></p>
<p>Program Limit Exceeded</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.PLPGSQLError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">PLPGSQLError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.PLPGSQLError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Error raised by a PL/PgSQL procedural function</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.PLPGSQLRaiseError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">PLPGSQLRaiseError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.PLPGSQLRaiseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.PLPGSQLError" title="postgresql.exceptions.PLPGSQLError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.PLPGSQLError</span></tt></a></p>
<p>Error raised by a PL/PgSQL RAISE statement.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ReadOnlyTransactionError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ReadOnlyTransactionError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ReadOnlyTransactionError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.ITSError" title="postgresql.exceptions.ITSError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ITSError</span></tt></a></p>
<p>Occurs when an alteration occurs in a read-only transaction.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.SEARVError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">SEARVError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.SEARVError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>Syntax Error or Access Rule Violation</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.SIOError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">SIOError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.SIOError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>System I/O</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.SREError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">SREError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.SREError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>SQL Routine Exception</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.SavepointError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">SavepointError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.SavepointError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.TransactionError</span></tt></p>
<p>Classification error designating errors that relate to savepoints.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.SchemaAndDataStatementsError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">SchemaAndDataStatementsError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.SchemaAndDataStatementsError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.ITSError" title="postgresql.exceptions.ITSError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.ITSError</span></tt></a></p>
<p>Mixed schema and data statements not allowed.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.ServerNotReadyError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">ServerNotReadyError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.ServerNotReadyError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.OIError" title="postgresql.exceptions.OIError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.OIError</span></tt></a>, <a class="reference internal" href="#postgresql.exceptions.Disconnection" title="postgresql.exceptions.Disconnection"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Disconnection</span></tt></a></p>
<p>Thrown when a connection is established to a server that is still starting up.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.TRError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">TRError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.TRError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.TransactionError</span></tt></p>
<p>Transaction Rollback</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.exceptions.TypeConversionWarning">
<em class="property">class </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">TypeConversionWarning</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.TypeConversionWarning" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverWarning</span></tt></p>
<p>Report a potential issue with a conversion.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.exceptions.TypeIOError">
<em class="property">exception </em><tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">TypeIOError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.TypeIOError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.DriverError" title="postgresql.exceptions.DriverError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.DriverError</span></tt></a></p>
<p>Driver failed to pack or unpack a tuple.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.exceptions.map_errors_and_warnings">
<tt class="descclassname">postgresql.exceptions.</tt><tt class="descname">map_errors_and_warnings</tt><big>(</big><em>objs</em>, <em>error_container={'': <class 'postgresql.exceptions.Error'></em>, <em>'--SEC': <class 'postgresql.exceptions.InsecurityError'></em>, <em>'21000': <class 'postgresql.exceptions.CardinalityError'></em>, <em>'08004': <class 'postgresql.exceptions.ConnectionRejectionError'></em>, <em>'34000': <class 'postgresql.exceptions.CursorNameError'></em>, <em>'08006': <class 'postgresql.exceptions.ConnectionFailureError'></em>, <em>'23514': <class 'postgresql.exceptions.CheckError'></em>, <em>'08000': <class 'postgresql.exceptions.ConnectionError'></em>, <em>'08003': <class 'postgresql.exceptions.ConnectionDoesNotExistError'></em>, <em>'0B000': <class 'postgresql.exceptions.TransactionInitiationError'></em>, <em>'P0001': <class 'postgresql.exceptions.PLPGSQLRaiseError'></em>, <em>'P0000': <class 'postgresql.exceptions.PLPGSQLError'></em>, <em>'P0003': <class 'postgresql.exceptions.PLPGSQLTooManyRowsError'></em>, <em>'P0002': <class 'postgresql.exceptions.PLPGSQLNoDataFoundError'></em>, <em>'2200M': <class 'postgresql.exceptions.XMLDocumentError'></em>, <em>'2200L': <class 'postgresql.exceptions.NotXMLError'></em>, <em>'2200N': <class 'postgresql.exceptions.XMLContentError'></em>, <em>'2200C': <class 'postgresql.exceptions.EscapeCharacterError'></em>, <em>'2200B': <class 'postgresql.exceptions.EscapeCharacterConflictError'></em>, <em>'57P01': <class 'postgresql.exceptions.AdminShutdownError'></em>, <em>'2200D': <class 'postgresql.exceptions.EscapeOctetError'></em>, <em>'2200G': <class 'postgresql.exceptions.SpecificTypeMismatch'></em>, <em>'2200F': <class 'postgresql.exceptions.ZeroLengthString'></em>, <em>'40001': <class 'postgresql.exceptions.SerializationError'></em>, <em>'40000': <class 'postgresql.exceptions.TRError'></em>, <em>'40003': <class 'postgresql.exceptions.StatementCompletionUnknownError'></em>, <em>'40002': <class 'postgresql.exceptions.IntegrityConstraintViolationError'></em>, <em>'2D000': <class 'postgresql.exceptions.TransactionTerminationError'></em>, <em>'42601': <class 'postgresql.exceptions.SyntaxError'></em>, <em>'2200S': <class 'postgresql.exceptions.XMLCommentError'></em>, <em>'42602': <class 'postgresql.exceptions.SEARVNameError'></em>, <em>'2200T': <class 'postgresql.exceptions.XMLProcessingInstructionError'></em>, <em>'0LP01': <class 'postgresql.exceptions.GrantorOperationError'></em>, <em>'08001': <class 'postgresql.exceptions.ClientCannotConnectError'></em>, <em>'53300': <class 'postgresql.exceptions.TooManyConnectionsError'></em>, <em>'44000': <class 'postgresql.exceptions.WithCheckOptionError'></em>, <em>'40P01': <class 'postgresql.exceptions.DeadlockError'></em>, <em>'22008': <class 'postgresql.exceptions.DateTimeFieldOverflowError'></em>, <em>'22021': <class 'postgresql.exceptions.EncodingError'></em>, <em>'42846': <class 'postgresql.exceptions.CoercionError'></em>, <em>'22001': <class 'postgresql.exceptions.StringRightTruncationError'></em>, <em>'22000': <class 'postgresql.exceptions.DataError'></em>, <em>'22003': <class 'postgresql.exceptions.NumericRangeError'></em>, <em>'22002': <class 'postgresql.exceptions.NullValueNoIndicatorParameter'></em>, <em>'22005': <class 'postgresql.exceptions.AssignmentError'></em>, <em>'22004': <class 'postgresql.exceptions.NullValueNotAllowedError'></em>, <em>'22007': <class 'postgresql.exceptions.DateTimeFormatError'></em>, <em>'42712': <class 'postgresql.exceptions.DuplicateAliasError'></em>, <em>'3F000': <class 'postgresql.exceptions.SchemaNameError'></em>, <em>'XX001': <class 'postgresql.exceptions.DataCorruptedError'></em>, <em>'XX000': <class 'postgresql.exceptions.InternalError'></em>, <em>'XX002': <class 'postgresql.exceptions.IndexCorruptedError'></em>, <em>'42710': <class 'postgresql.exceptions.DuplicateObjectError'></em>, <em>'08P01': <class 'postgresql.exceptions.ProtocolError'></em>, <em>'53000': <class 'postgresql.exceptions.IRError'></em>, <em>'38001': <class 'postgresql.exceptions.ContainingSQLNotPermittedError'></em>, <em>'26000': <class 'postgresql.exceptions.StatementNameError'></em>, <em>'08007': <class 'postgresql.exceptions.TransactionResolutionUnknownError'></em>, <em>'3D000': <class 'postgresql.exceptions.CatalogNameError'></em>, <em>'42611': <class 'postgresql.exceptions.ColumnDefinitionError'></em>, <em>'0P000': <class 'postgresql.exceptions.RoleSpecificationError'></em>, <em>'42P20': <class 'postgresql.exceptions.WindowError'></em>, <em>'09000': <class 'postgresql.exceptions.TriggeredActionError'></em>, <em>'22018': <class 'postgresql.exceptions.CastCharacterValueError'></em>, <em>'42501': <class 'postgresql.exceptions.InsufficientPrivilegeError'></em>, <em>'39P01': <class 'postgresql.exceptions.TriggerProtocolError'></em>, <em>'39P02': <class 'postgresql.exceptions.SRFProtocolError'></em>, <em>'22012': <class 'postgresql.exceptions.ZeroDivisionError'></em>, <em>'22010': <class 'postgresql.exceptions.IndicatorParameterValueError'></em>, <em>'22011': <class 'postgresql.exceptions.SubstringError'></em>, <em>'--TIO': <class 'postgresql.exceptions.TypeIOError'></em>, <em>'22015': <class 'postgresql.exceptions.IntervalFieldOverflowError'></em>, <em>'0L000': <class 'postgresql.exceptions.GrantorError'></em>, <em>'25P01': <class 'postgresql.exceptions.NoActiveTransactionError'></em>, <em>'25P02': <class 'postgresql.exceptions.InFailedTransactionError'></em>, <em>'22020': <class 'postgresql.exceptions.LimitValueError'></em>, <em>'39004': <class 'postgresql.exceptions.NullValueNotAllowed'></em>, <em>'2202E': <class 'postgresql.exceptions.ArrayElementError'></em>, <em>'39001': <class 'postgresql.exceptions.InvalidSQLState'></em>, <em>'39000': <class 'postgresql.exceptions.ERIEError'></em>, <em>'2B000': <class 'postgresql.exceptions.DPDSEError'></em>, <em>'22P01': <class 'postgresql.exceptions.FloatingPointError'></em>, <em>'22P03': <class 'postgresql.exceptions.BinaryRepresentationError'></em>, <em>'22P02': <class 'postgresql.exceptions.TextRepresentationError'></em>, <em>'22P05': <class 'postgresql.exceptions.UntranslatableCharacterError'></em>, <em>'22P04': <class 'postgresql.exceptions.BadCopyError'></em>, <em>'22P06': <class 'postgresql.exceptions.NonstandardUseOfEscapeCharacterError'></em>, <em>'22027': <class 'postgresql.exceptions.TrimError'></em>, <em>'22026': <class 'postgresql.exceptions.StringDataLengthError'></em>, <em>'22025': <class 'postgresql.exceptions.EscapeSequenceError'></em>, <em>'22024': <class 'postgresql.exceptions.UnterminatedCStringError'></em>, <em>'22023': <class 'postgresql.exceptions.ParameterValueError'></em>, <em>'22022': <class 'postgresql.exceptions.IndicatorOverflowError'></em>, <em>'0F001': <class 'postgresql.exceptions.LocatorSpecificationError'></em>, <em>'0F000': <class 'postgresql.exceptions.LocatorError'></em>, <em>'58000': <class 'postgresql.exceptions.SIOError'></em>, <em>'23503': <class 'postgresql.exceptions.ForeignKeyError'></em>, <em>'3B000': <class 'postgresql.exceptions.SavepointError'></em>, <em>'3B001': <class 'postgresql.exceptions.InvalidSavepointSpecificationError'></em>, <em>'55P03': <class 'postgresql.exceptions.UnavailableLockError'></em>, <em>'55P02': <class 'postgresql.exceptions.ImmutableRuntimeParameterError'></em>, <em>'F0001': <class 'postgresql.exceptions.LockFileExistsError'></em>, <em>'F0000': <class 'postgresql.exceptions.CFError'></em>, <em>'2201B': <class 'postgresql.exceptions.RegularExpressionError'></em>, <em>'2201F': <class 'postgresql.exceptions.PowerFunctionArgumentError'></em>, <em>'2201G': <class 'postgresql.exceptions.WidthBucketFunctionArgumentError'></em>, <em>'2201E': <class 'postgresql.exceptions.LogArgumentError'></em>, <em>'2201X': <class 'postgresql.exceptions.OffsetValueError'></em>, <em>'55000': <class 'postgresql.exceptions.ONIPSError'></em>, <em>'55006': <class 'postgresql.exceptions.ObjectInUseError'></em>, <em>'42939': <class 'postgresql.exceptions.ReservedNameError'></em>, <em>'42P09': <class 'postgresql.exceptions.AmbiguousAliasError'></em>, <em>'42P08': <class 'postgresql.exceptions.AmbiguousParameterError'></em>, <em>'42P07': <class 'postgresql.exceptions.DuplicateTableError'></em>, <em>'42P06': <class 'postgresql.exceptions.DuplicateSchemaError'></em>, <em>'42P05': <class 'postgresql.exceptions.DuplicatePreparedStatementError'></em>, <em>'42P04': <class 'postgresql.exceptions.DuplicateDatabaseError'></em>, <em>'42P03': <class 'postgresql.exceptions.DuplicateCursorError'></em>, <em>'42P02': <class 'postgresql.exceptions.UndefinedParameterError'></em>, <em>'42P01': <class 'postgresql.exceptions.UndefinedTableError'></em>, <em>'--cIO': <class 'postgresql.exceptions.CompositeError'></em>, <em>'57P03': <class 'postgresql.exceptions.ServerNotReadyError'></em>, <em>'42830': <class 'postgresql.exceptions.ForeignKeyCreationError'></em>, <em>'57P02': <class 'postgresql.exceptions.CrashShutdownError'></em>, <em>'24000': <class 'postgresql.exceptions.CursorStateError'></em>, <em>'58P01': <class 'postgresql.exceptions.UndefinedFileError'></em>, <em>'58P02': <class 'postgresql.exceptions.DuplicateFileError'></em>, <em>'27000': <class 'postgresql.exceptions.TriggeredDataChangeViolation'></em>, <em>'42723': <class 'postgresql.exceptions.DuplicateFunctionError'></em>, <em>'42725': <class 'postgresql.exceptions.AmbiguousFunctionError'></em>, <em>'42P18': <class 'postgresql.exceptions.IndeterminateTypeError'></em>, <em>'42P19': <class 'postgresql.exceptions.RecursionError'></em>, <em>'42804': <class 'postgresql.exceptions.TypeMismatchError'></em>, <em>'03000': <class 'postgresql.exceptions.SQLNotYetCompleteError'></em>, <em>'42P10': <class 'postgresql.exceptions.ColumnReferenceError'></em>, <em>'42P11': <class 'postgresql.exceptions.CursorDefinitionError'></em>, <em>'42P12': <class 'postgresql.exceptions.DatabaseDefinitionError'></em>, <em>'42P13': <class 'postgresql.exceptions.FunctionDefinitionError'></em>, <em>'42P14': <class 'postgresql.exceptions.PreparedStatementDefinitionError'></em>, <em>'57000': <class 'postgresql.exceptions.OIError'></em>, <em>'42P16': <class 'postgresql.exceptions.TableDefinitionError'></em>, <em>'42P17': <class 'postgresql.exceptions.ObjectDefinitionError'></em>, <em>'53200': <class 'postgresql.exceptions.MemoryError'></em>, <em>'20000': <class 'postgresql.exceptions.CaseNotFoundError'></em>, <em>'2F005': <class 'postgresql.exceptions.FunctionExecutedNoReturnStatementError'></em>, <em>'2F004': <class 'postgresql.exceptions.ReadingDataProhibitedError'></em>, <em>'2F000': <class 'postgresql.exceptions.SREError'></em>, <em>'2F003': <class 'postgresql.exceptions.StatementProhibitedError'></em>, <em>'2F002': <class 'postgresql.exceptions.DataModificationProhibitedError'></em>, <em>'38004': <class 'postgresql.exceptions.ReadingSQLDataNotPermittedError'></em>, <em>'38002': <class 'postgresql.exceptions.ModifyingSQLDataNotPermittedError'></em>, <em>'38003': <class 'postgresql.exceptions.ProhibitedSQLStatementError'></em>, <em>'38000': <class 'postgresql.exceptions.EREError'></em>, <em>'42000': <class 'postgresql.exceptions.SEARVError'></em>, <em>'23000': <class 'postgresql.exceptions.ICVError'></em>, <em>'23001': <class 'postgresql.exceptions.RestrictError'></em>, <em>'--PIO': <class 'postgresql.exceptions.ParameterError'></em>, <em>'57014': <class 'postgresql.exceptions.QueryCanceledError'></em>, <em>'42803': <class 'postgresql.exceptions.GroupingError'></em>, <em>'28000': <class 'postgresql.exceptions.AuthenticationSpecificationError'></em>, <em>'0A000': <class 'postgresql.exceptions.FeatureError'></em>, <em>'42701': <class 'postgresql.exceptions.DuplicateColumnError'></em>, <em>'42702': <class 'postgresql.exceptions.AmbiguousColumnError'></em>, <em>'42703': <class 'postgresql.exceptions.UndefinedColumnError'></em>, <em>'42704': <class 'postgresql.exceptions.UndefinedObjectError'></em>, <em>'2BP01': <class 'postgresql.exceptions.DPDSEObjectError'></em>, <em>'--CIO': <class 'postgresql.exceptions.ColumnError'></em>, <em>'42883': <class 'postgresql.exceptions.UndefinedFunctionError'></em>, <em>'25004': <class 'postgresql.exceptions.BadIsolationForBranchError'></em>, <em>'25005': <class 'postgresql.exceptions.NoActiveTransactionForBranchError'></em>, <em>'25006': <class 'postgresql.exceptions.ReadOnlyTransactionError'></em>, <em>'25007': <class 'postgresql.exceptions.SchemaAndDataStatementsError'></em>, <em>'25000': <class 'postgresql.exceptions.ITSError'></em>, <em>'25001': <class 'postgresql.exceptions.ActiveTransactionError'></em>, <em>'25002': <class 'postgresql.exceptions.BranchAlreadyActiveError'></em>, <em>'25003': <class 'postgresql.exceptions.BadAccessModeForBranchError'></em>, <em>'--OPE': <class 'postgresql.exceptions.OperationError'></em>, <em>'23505': <class 'postgresql.exceptions.UniqueError'></em>, <em>'25008': <class 'postgresql.exceptions.InconsistentCursorIsolationError'></em>, <em>'23502': <class 'postgresql.exceptions.NotNullError'></em>, <em>'42P15': <class 'postgresql.exceptions.SchemaDefinitionError'></em>, <em>'--TOE': <class 'postgresql.exceptions.ConnectTimeoutError'></em>, <em>'42809': <class 'postgresql.exceptions.WrongObjectTypeError'></em>, <em>'42622': <class 'postgresql.exceptions.NameTooLongError'></em>, <em>'22009': <class 'postgresql.exceptions.TimeZoneDisplacementValueError'></em>, <em>'--000': <class 'postgresql.exceptions.DriverError'></em>, <em>'--AUT': <class 'postgresql.exceptions.AuthenticationMethodError'></em>, <em>'2201W': <class 'postgresql.exceptions.LimitValueError'></em>, <em>'53100': <class 'postgresql.exceptions.DiskFullError'>}</em>, <em>warning_container={'01-TP': <class 'postgresql.exceptions.TypeConversionWarning'></em>, <em>'02001': <class 'postgresql.exceptions.NoMoreSetsReturned'></em>, <em>'02000': <class 'postgresql.exceptions.NoDataWarning'></em>, <em>'01008': <class 'postgresql.exceptions.ImplicitZeroBitPaddingWarning'></em>, <em>'01006': <class 'postgresql.exceptions.PrivilegeNotRevokedWarning'></em>, <em>'01007': <class 'postgresql.exceptions.PrivilegeNotGrantedWarning'></em>, <em>'01004': <class 'postgresql.exceptions.StringDataRightTruncationWarning'></em>, <em>'01003': <class 'postgresql.exceptions.NullValueEliminatedInSetFunctionWarning'></em>, <em>'01000': <class 'postgresql.exceptions.Warning'></em>, <em>'01P01': <class 'postgresql.exceptions.DeprecationWarning'></em>, <em>'01-CP': <class 'postgresql.exceptions.IgnoredClientParameterWarning'></em>, <em>'01-00': <class 'postgresql.exceptions.DriverWarning'></em>, <em>'0100C': <class 'postgresql.exceptions.DynamicResultSetsReturnedWarning'>}</em><big>)</big><a class="headerlink" href="#postgresql.exceptions.map_errors_and_warnings" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct the code-to-error and code-to-warning associations.</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.temporal">
<span id="postgresql-temporal"></span><h2><a class="reference internal" href="#module-postgresql.temporal" title="postgresql.temporal"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.temporal</span></tt></a><a class="headerlink" href="#module-postgresql.temporal" title="Permalink to this headline">¶</a></h2>
<p>Temporary PostgreSQL cluster for the process.</p>
<dl class="class">
<dt id="postgresql.temporal.Temporal">
<em class="property">class </em><tt class="descclassname">postgresql.temporal.</tt><tt class="descname">Temporal</tt><a class="headerlink" href="#postgresql.temporal.Temporal" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
<p>Manages a temporary cluster for the duration of the process.</p>
<p>Instances of this class reference a distinct cluster. These clusters are
transient; they will only exist until the process exits.</p>
<p>Usage:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">postgresql.temporal</span> <span class="kn">import</span> <span class="n">pg_tmp</span>
<span class="gp">>>> </span><span class="k">with</span> <span class="n">pg_tmp</span><span class="p">:</span>
<span class="gp">... </span> <span class="n">ps</span> <span class="o">=</span> <span class="n">db</span><span class="o">.</span><span class="n">prepare</span><span class="p">(</span><span class="s">'SELECT 1'</span><span class="p">)</span>
<span class="gp">... </span> <span class="k">assert</span> <span class="n">ps</span><span class="o">.</span><span class="n">first</span><span class="p">()</span> <span class="o">==</span> <span class="mi">1</span>
</pre></div>
</div>
<p>Or <cite>pg_tmp</cite> can decorate a method or function.</p>
<dl class="method">
<dt id="postgresql.temporal.Temporal.cluster_dirname">
<tt class="descname">cluster_dirname</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.temporal.Temporal.cluster_dirname" title="Permalink to this definition">¶</a></dt>
<dd><p>S.format(<a href="#id1"><span class="problematic" id="id2">*</span></a>args, <a href="#id3"><span class="problematic" id="id4">**</span></a>kwargs) -> str</p>
<p>Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces (‘{‘ and ‘}’).</p>
</dd></dl>
</dd></dl>
<dl class="data">
<dt id="postgresql.temporal.pg_tmp">
<tt class="descclassname">postgresql.temporal.</tt><tt class="descname">pg_tmp</tt><em class="property"> = <postgresql.temporal.Temporal object at 0x102035190></em><a class="headerlink" href="#postgresql.temporal.pg_tmp" title="Permalink to this definition">¶</a></dt>
<dd><p>The process’ temporary cluster.</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.installation">
<span id="postgresql-installation"></span><h2><a class="reference internal" href="#module-postgresql.installation" title="postgresql.installation"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.installation</span></tt></a><a class="headerlink" href="#module-postgresql.installation" title="Permalink to this headline">¶</a></h2>
<p>Collect and access PostgreSQL installation information.</p>
<dl class="class">
<dt id="postgresql.installation.Installation">
<em class="property">class </em><tt class="descclassname">postgresql.installation.</tt><tt class="descname">Installation</tt><big>(</big><em>info</em><big>)</big><a class="headerlink" href="#postgresql.installation.Installation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.api.Installation" title="postgresql.api.Installation"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.api.Installation</span></tt></a></p>
<p>Class providing a Python interface to PostgreSQL installation information.</p>
<dl class="attribute">
<dt id="postgresql.installation.Installation.ssl">
<tt class="descname">ssl</tt><a class="headerlink" href="#postgresql.installation.Installation.ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the installation was compiled with SSL support.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="postgresql.installation.default">
<tt class="descclassname">postgresql.installation.</tt><tt class="descname">default</tt><big>(</big><em>typ=<class 'postgresql.installation.Installation'></em><big>)</big><a class="headerlink" href="#postgresql.installation.default" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the default Installation.</p>
<p>Uses default_pg_config() to identify the executable.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.installation.default_pg_config">
<tt class="descclassname">postgresql.installation.</tt><tt class="descname">default_pg_config</tt><big>(</big><em>execname='pg_config'</em>, <em>envkey='PGINSTALLATION'</em><big>)</big><a class="headerlink" href="#postgresql.installation.default_pg_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the default <cite>pg_config</cite> executable on the system.</p>
<p>If ‘PGINSTALLATION’ is in the environment, use it.
Otherwise, look through the system’s PATH environment.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.installation.pg_config_dictionary">
<tt class="descclassname">postgresql.installation.</tt><tt class="descname">pg_config_dictionary</tt><big>(</big><em>*pg_config_path</em><big>)</big><a class="headerlink" href="#postgresql.installation.pg_config_dictionary" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.cluster">
<span id="postgresql-cluster"></span><h2><a class="reference internal" href="#module-postgresql.cluster" title="postgresql.cluster"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.cluster</span></tt></a><a class="headerlink" href="#module-postgresql.cluster" title="Permalink to this headline">¶</a></h2>
<p>Create, control, and destroy PostgreSQL clusters.</p>
<p>postgresql.cluster provides a programmer’s interface to controlling a PostgreSQL
cluster. It provides direct access to proper signalling interfaces.</p>
<dl class="class">
<dt id="postgresql.cluster.Cluster">
<em class="property">class </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">Cluster</tt><big>(</big><em>installation</em>, <em>data_directory</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.api.Cluster" title="postgresql.api.Cluster"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.api.Cluster</span></tt></a></p>
<p>Interface to a PostgreSQL cluster.</p>
<p>Provides mechanisms to start, stop, restart, kill, drop, and initalize a
cluster(data directory).</p>
<p>Cluster does not strive to be consistent with <tt class="docutils literal"><span class="pre">pg_ctl</span></tt>. This is considered
to be a base class for managing a cluster, and is intended to be extended to
accommodate for a particular purpose.</p>
<dl class="method">
<dt id="postgresql.cluster.Cluster.address">
<tt class="descname">address</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.address" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the host-port pair from the configuration.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.connect">
<tt class="descname">connect</tt><big>(</big><em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an established connection from the connector.</p>
<p>Cluster must be running.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.connection">
<tt class="descname">connection</tt><big>(</big><em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a connection object to the cluster, but do not connect.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.connector">
<tt class="descname">connector</tt><big>(</big><em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.connector" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a postgresql.driver connector based on the given keywords and
listen_addresses and port configuration in settings.</p>
</dd></dl>
<dl class="attribute">
<dt id="postgresql.cluster.Cluster.daemon_path">
<tt class="descname">daemon_path</tt><a class="headerlink" href="#postgresql.cluster.Cluster.daemon_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Path to the executable to use to startup the cluster.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.drop">
<tt class="descname">drop</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Stop the cluster and remove it from the filesystem</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.get_pid_from_file">
<tt class="descname">get_pid_from_file</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.get_pid_from_file" title="Permalink to this definition">¶</a></dt>
<dd><p>The current pid from the postmaster.pid file.</p>
</dd></dl>
<dl class="attribute">
<dt id="postgresql.cluster.Cluster.hba_file">
<tt class="descname">hba_file</tt><a class="headerlink" href="#postgresql.cluster.Cluster.hba_file" title="Permalink to this definition">¶</a></dt>
<dd><p>The path to the HBA file of the cluster.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.init">
<tt class="descname">init</tt><big>(</big><em>password=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the cluster at the given <cite>data_directory</cite> using the
provided keyword parameters as options to the command.</p>
<p><cite>command_option_map</cite> provides the mapping of keyword arguments
to command options.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.initialized">
<tt class="descname">initialized</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.initialized" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether or not the data directory <em>appears</em> to be a valid cluster.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.kill">
<tt class="descname">kill</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.kill" title="Permalink to this definition">¶</a></dt>
<dd><p>Stop the cluster immediately(SIGKILL).</p>
<p>Does <em>not</em> wait for shutdown.</p>
</dd></dl>
<dl class="attribute">
<dt id="postgresql.cluster.Cluster.pid">
<tt class="descname">pid</tt><a class="headerlink" href="#postgresql.cluster.Cluster.pid" title="Permalink to this definition">¶</a></dt>
<dd><p>If we have the subprocess, use the pid on the object.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.ready_for_connections">
<tt class="descname">ready_for_connections</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.ready_for_connections" title="Permalink to this definition">¶</a></dt>
<dd><p>If the daemon is running, and is not in startup mode.</p>
<p>This only works for clusters configured for TCP/IP connections.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.reload">
<tt class="descname">reload</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.reload" title="Permalink to this definition">¶</a></dt>
<dd><p>Signal the cluster to reload its configuration file.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.restart">
<tt class="descname">restart</tt><big>(</big><em>logfile=None</em>, <em>settings=None</em>, <em>timeout=10</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.restart" title="Permalink to this definition">¶</a></dt>
<dd><p>Restart the cluster gracefully.</p>
<p>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.</p>
<p>If waiting is not desired, .start() and .stop() should be used directly.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.running">
<tt class="descname">running</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.running" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether or not the postmaster is running.</p>
<p>This does <em>not</em> mean the cluster is accepting connections.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.shutdown">
<tt class="descname">shutdown</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.shutdown" title="Permalink to this definition">¶</a></dt>
<dd><p>Shutdown the cluster as soon as possible, disconnecting clients.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.start">
<tt class="descname">start</tt><big>(</big><em>logfile=None</em>, <em>settings=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.start" title="Permalink to this definition">¶</a></dt>
<dd><p>Start the cluster.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.stop">
<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.stop" title="Permalink to this definition">¶</a></dt>
<dd><p>Stop the cluster gracefully waiting for clients to disconnect(SIGTERM).</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.wait_until_started">
<tt class="descname">wait_until_started</tt><big>(</big><em>timeout=10</em>, <em>delay=0.05</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.wait_until_started" title="Permalink to this definition">¶</a></dt>
<dd><p>After the <cite>start</cite> method is used, this can be ran in order to block
until the cluster is ready for use.</p>
<p>This method loops until <cite>ready_for_connections</cite> returns <cite>True</cite> in
order to make sure that the cluster is actually up.</p>
</dd></dl>
<dl class="method">
<dt id="postgresql.cluster.Cluster.wait_until_stopped">
<tt class="descname">wait_until_stopped</tt><big>(</big><em>timeout=10</em>, <em>delay=0.05</em><big>)</big><a class="headerlink" href="#postgresql.cluster.Cluster.wait_until_stopped" title="Permalink to this definition">¶</a></dt>
<dd><p>After the <cite>stop</cite> method is used, this can be ran in order to block until
the cluster is shutdown.</p>
<p>Additionally, catching <cite>ClusterTimeoutError</cite> exceptions would be a
starting point for making decisions about whether or not to issue a kill
to the daemon.</p>
</dd></dl>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.ClusterError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.exceptions.Error" title="postgresql.exceptions.Error"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Error</span></tt></a></p>
<p>General cluster error.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.ClusterInitializationError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterInitializationError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterInitializationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.cluster.ClusterError" title="postgresql.cluster.ClusterError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.cluster.ClusterError</span></tt></a></p>
<p>General cluster initialization failure</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.ClusterNotRunningError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterNotRunningError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterNotRunningError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.cluster.ClusterError" title="postgresql.cluster.ClusterError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.cluster.ClusterError</span></tt></a></p>
<p>Cluster is not running</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.ClusterStartupError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterStartupError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterStartupError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.cluster.ClusterError" title="postgresql.cluster.ClusterError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.cluster.ClusterError</span></tt></a></p>
<p>Cluster startup failed</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.ClusterTimeoutError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterTimeoutError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterTimeoutError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.cluster.ClusterError" title="postgresql.cluster.ClusterError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.cluster.ClusterError</span></tt></a></p>
<p>Cluster operation timed out</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.cluster.ClusterWarning">
<em class="property">class </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">ClusterWarning</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.ClusterWarning" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.exceptions.Warning</span></tt></p>
<p>Warning issued by cluster operations</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.cluster.InitDBError">
<em class="property">exception </em><tt class="descclassname">postgresql.cluster.</tt><tt class="descname">InitDBError</tt><big>(</big><em>message</em>, <em>code=None</em>, <em>details={}</em>, <em>source=None</em>, <em>creator=None</em><big>)</big><a class="headerlink" href="#postgresql.cluster.InitDBError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#postgresql.cluster.ClusterInitializationError" title="postgresql.cluster.ClusterInitializationError"><tt class="xref py py-class docutils literal"><span class="pre">postgresql.cluster.ClusterInitializationError</span></tt></a></p>
<p>A non-zero result was returned by the initdb command</p>
</dd></dl>
</div>
<div class="section" id="module-postgresql.copyman">
<span id="postgresql-copyman"></span><h2><a class="reference internal" href="#module-postgresql.copyman" title="postgresql.copyman"><tt class="xref py py-mod docutils literal"><span class="pre">postgresql.copyman</span></tt></a><a class="headerlink" href="#module-postgresql.copyman" title="Permalink to this headline">¶</a></h2>
<p>Manage complex COPY operations; one-to-many COPY streaming.</p>
<p>Primarily this module houses the <cite>CopyManager</cite> class, and the <cite>transfer</cite>
function for a high-level interface to using the <cite>CopyManager</cite>.</p>
<dl class="class">
<dt id="postgresql.copyman.CallReceiver">
<em class="property">class </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">CallReceiver</tt><big>(</big><em>callable</em><big>)</big><a class="headerlink" href="#postgresql.copyman.CallReceiver" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.copyman.Receiver</span></tt></p>
<p>Call the given object with a list of COPY lines.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.copyman.CopyFail">
<em class="property">exception </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">CopyFail</tt><big>(</big><em>manager</em>, <em>reason=None</em>, <em>receiver_faults=None</em>, <em>producer_fault=None</em><big>)</big><a class="headerlink" href="#postgresql.copyman.CopyFail" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.Exception</span></tt></p>
<p>Exception thrown by the CopyManager when the COPY operation failed.</p>
<p>The ‘manager’ attribute the CopyManager that raised the CopyFail.</p>
<p>The ‘reason’ attribute is a string indicating why it failed.</p>
<p>The ‘receiver_faults’ attribute is a mapping of receivers to exceptions that were
raised on exit.</p>
<p>The ‘producer_fault’ attribute specifies if the producer raise an exception
on exit.</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.copyman.CopyManager">
<em class="property">class </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">CopyManager</tt><big>(</big><em>producer</em>, <em>*receivers</em><big>)</big><a class="headerlink" href="#postgresql.copyman.CopyManager" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.python.element.Element</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">_abcoll.Iterator</span></tt></p>
<p>A class for managing COPY operations.</p>
<p>Connects the producer to the receivers.</p>
<dl class="method">
<dt id="postgresql.copyman.CopyManager.reconcile">
<tt class="descname">reconcile</tt><big>(</big><em>r</em><big>)</big><a class="headerlink" href="#postgresql.copyman.CopyManager.reconcile" title="Permalink to this definition">¶</a></dt>
<dd><p>Reconcile a receiver that faulted.</p>
<p>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.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="postgresql.copyman.NullProducer">
<em class="property">class </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">NullProducer</tt><a class="headerlink" href="#postgresql.copyman.NullProducer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.copyman.Producer</span></tt></p>
<p>Produces no copy data.</p>
</dd></dl>
<dl class="exception">
<dt id="postgresql.copyman.ProducerFault">
<em class="property">exception </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">ProducerFault</tt><big>(</big><em>manager</em><big>)</big><a class="headerlink" href="#postgresql.copyman.ProducerFault" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.copyman.Fault</span></tt></p>
<p>Exception raised when the Producer caused an exception.</p>
<p>Normally, Producer faults are fatal.</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.copyman.ProtocolProducer">
<em class="property">class </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">ProtocolProducer</tt><big>(</big><em>recv_into</em>, <em>buffer_size=10240</em><big>)</big><a class="headerlink" href="#postgresql.copyman.ProtocolProducer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.copyman.Producer</span></tt></p>
<p>Producer using a PQv3 data stream.</p>
<p>Normally, this class needs to be subclassed as it assumes that the given
recv_into function will write COPY messages.</p>
<dl class="method">
<dt id="postgresql.copyman.ProtocolProducer.recover">
<tt class="descname">recover</tt><big>(</big><em>view</em><big>)</big><a class="headerlink" href="#postgresql.copyman.ProtocolProducer.recover" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a view containing data read from the wire, recover the
controller’s state.</p>
<p>This needs to be implemented by subclasses in order for the
ProtocolReceiver to pass control back to the original state machine.</p>
</dd></dl>
</dd></dl>
<dl class="exception">
<dt id="postgresql.copyman.ReceiverFault">
<em class="property">exception </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">ReceiverFault</tt><big>(</big><em>manager</em>, <em>faults</em><big>)</big><a class="headerlink" href="#postgresql.copyman.ReceiverFault" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">postgresql.copyman.Fault</span></tt></p>
<p>Exception raised when Receivers cause an exception.</p>
<p>Faults should be trapped if recovery from an exception is
possible, or if the failed receiver is optional to the succes of the
operation.</p>
<p>The ‘manager’ attribute is the CopyManager that raised the fault.</p>
<p>The ‘faults’ attribute is a dictionary mapping the receiver to the exception
instance raised.</p>
</dd></dl>
<dl class="class">
<dt id="postgresql.copyman.WireState">
<em class="property">class </em><tt class="descclassname">postgresql.copyman.</tt><tt class="descname">WireState</tt><big>(</big><em>condition=<method-wrapper '__ne__' of bytes object at 0x1023a7878></em><big>)</big><a class="headerlink" href="#postgresql.copyman.WireState" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
<p>Manages the state of the wire.</p>
<p>This class manages three possible positions:</p>
<blockquote>
<div><ol class="arabic simple">
<li>Between wire messages</li>
<li>Inside message header</li>
<li>Inside message (with complete header)</li>
</ol>
</div></blockquote>
<p>The wire state will become unusable when the configured condition is True.</p>
<dl class="method">
<dt id="postgresql.copyman.WireState.update">
<tt class="descname">update</tt><big>(</big><em>view</em>, <em>getlen=<function unpack at 0x1021695a0></em>, <em>len=<built-in function len></em><big>)</big><a class="headerlink" href="#postgresql.copyman.WireState.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Given the state of the COPY and new data, advance the position on the
COPY stream.</p>
</dd></dl>
</dd></dl>
<dl class="data">
<dt id="postgresql.copyman.default_buffer_size">
<tt class="descclassname">postgresql.copyman.</tt><tt class="descname">default_buffer_size</tt><em class="property"> = 10240</em><a class="headerlink" href="#postgresql.copyman.default_buffer_size" title="Permalink to this definition">¶</a></dt>
<dd><p>10KB buffer for COPY messages by default.</p>
</dd></dl>
<dl class="function">
<dt id="postgresql.copyman.transfer">
<tt class="descclassname">postgresql.copyman.</tt><tt class="descname">transfer</tt><big>(</big><em>producer</em>, <em>*receivers</em><big>)</big><a class="headerlink" href="#postgresql.copyman.transfer" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform a COPY operation using the given statements:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">copyman</span>
<span class="gp">>>> </span><span class="n">copyman</span><span class="o">.</span><span class="n">transfer</span><span class="p">(</span><span class="n">src</span><span class="o">.</span><span class="n">prepare</span><span class="p">(</span><span class="s">"COPY table TO STDOUT"</span><span class="p">),</span> <span class="n">dst</span><span class="o">.</span><span class="n">prepare</span><span class="p">(</span><span class="s">"COPY table FROM STDIN"</span><span class="p">))</span>
</pre></div>
</div>
</dd></dl>