pq-sys 0.7.5

Auto-generated rust bindings for libpq
Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
/* automatically generated by rust-bindgen 0.72.1 */

use libc::FILE;

pub const PG_DIAG_SEVERITY: u8 = 83u8;
pub const PG_DIAG_SEVERITY_NONLOCALIZED: u8 = 86u8;
pub const PG_DIAG_SQLSTATE: u8 = 67u8;
pub const PG_DIAG_MESSAGE_PRIMARY: u8 = 77u8;
pub const PG_DIAG_MESSAGE_DETAIL: u8 = 68u8;
pub const PG_DIAG_MESSAGE_HINT: u8 = 72u8;
pub const PG_DIAG_STATEMENT_POSITION: u8 = 80u8;
pub const PG_DIAG_INTERNAL_POSITION: u8 = 112u8;
pub const PG_DIAG_INTERNAL_QUERY: u8 = 113u8;
pub const PG_DIAG_CONTEXT: u8 = 87u8;
pub const PG_DIAG_SCHEMA_NAME: u8 = 115u8;
pub const PG_DIAG_TABLE_NAME: u8 = 116u8;
pub const PG_DIAG_COLUMN_NAME: u8 = 99u8;
pub const PG_DIAG_DATATYPE_NAME: u8 = 100u8;
pub const PG_DIAG_CONSTRAINT_NAME: u8 = 110u8;
pub const PG_DIAG_SOURCE_FILE: u8 = 70u8;
pub const PG_DIAG_SOURCE_LINE: u8 = 76u8;
pub const PG_DIAG_SOURCE_FUNCTION: u8 = 82u8;
pub const LIBPQ_HAS_PIPELINING: u32 = 1;
pub const LIBPQ_HAS_TRACE_FLAGS: u32 = 1;
pub const LIBPQ_HAS_SSL_LIBRARY_DETECTION: u32 = 1;
pub const LIBPQ_HAS_ASYNC_CANCEL: u32 = 1;
pub const LIBPQ_HAS_CHANGE_PASSWORD: u32 = 1;
pub const LIBPQ_HAS_CHUNK_MODE: u32 = 1;
pub const LIBPQ_HAS_CLOSE_PREPARED: u32 = 1;
pub const LIBPQ_HAS_SEND_PIPELINE_SYNC: u32 = 1;
pub const LIBPQ_HAS_SOCKET_POLL: u32 = 1;
pub const LIBPQ_HAS_FULL_PROTOCOL_VERSION: u32 = 1;
pub const LIBPQ_HAS_PROMPT_OAUTH_DEVICE: u32 = 1;
pub const PG_COPYRES_ATTRS: u32 = 1;
pub const PG_COPYRES_TUPLES: u32 = 2;
pub const PG_COPYRES_EVENTS: u32 = 4;
pub const PG_COPYRES_NOTICEHOOKS: u32 = 8;
pub const PQTRACE_SUPPRESS_TIMESTAMPS: u32 = 1;
pub const PQTRACE_REGRESS_MODE: u32 = 2;
pub const PQ_QUERY_PARAM_MAX_LIMIT: u32 = 65535;
pub const PQnoPasswordSupplied: &[u8; 35] = b"fe_sendauth: no password supplied\n\0";
pub type Oid = ::std::os::raw::c_uint;
pub type pg_int64 = i64;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ConnStatusType {
    CONNECTION_OK = 0,
    CONNECTION_BAD = 1,
    CONNECTION_STARTED = 2,
    CONNECTION_MADE = 3,
    CONNECTION_AWAITING_RESPONSE = 4,
    CONNECTION_AUTH_OK = 5,
    CONNECTION_SETENV = 6,
    CONNECTION_SSL_STARTUP = 7,
    CONNECTION_NEEDED = 8,
    CONNECTION_CHECK_WRITABLE = 9,
    CONNECTION_CONSUME = 10,
    CONNECTION_GSS_STARTUP = 11,
    CONNECTION_CHECK_TARGET = 12,
    CONNECTION_CHECK_STANDBY = 13,
    CONNECTION_ALLOCATED = 14,
    CONNECTION_AUTHENTICATING = 15,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PostgresPollingStatusType {
    PGRES_POLLING_FAILED = 0,
    PGRES_POLLING_READING = 1,
    PGRES_POLLING_WRITING = 2,
    PGRES_POLLING_OK = 3,
    PGRES_POLLING_ACTIVE = 4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ExecStatusType {
    PGRES_EMPTY_QUERY = 0,
    PGRES_COMMAND_OK = 1,
    PGRES_TUPLES_OK = 2,
    PGRES_COPY_OUT = 3,
    PGRES_COPY_IN = 4,
    PGRES_BAD_RESPONSE = 5,
    PGRES_NONFATAL_ERROR = 6,
    PGRES_FATAL_ERROR = 7,
    PGRES_COPY_BOTH = 8,
    PGRES_SINGLE_TUPLE = 9,
    PGRES_PIPELINE_SYNC = 10,
    PGRES_PIPELINE_ABORTED = 11,
    PGRES_TUPLES_CHUNK = 12,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGTransactionStatusType {
    PQTRANS_IDLE = 0,
    PQTRANS_ACTIVE = 1,
    PQTRANS_INTRANS = 2,
    PQTRANS_INERROR = 3,
    PQTRANS_UNKNOWN = 4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGVerbosity {
    PQERRORS_TERSE = 0,
    PQERRORS_DEFAULT = 1,
    PQERRORS_VERBOSE = 2,
    PQERRORS_SQLSTATE = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGContextVisibility {
    PQSHOW_CONTEXT_NEVER = 0,
    PQSHOW_CONTEXT_ERRORS = 1,
    PQSHOW_CONTEXT_ALWAYS = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGPing {
    PQPING_OK = 0,
    PQPING_REJECT = 1,
    PQPING_NO_RESPONSE = 2,
    PQPING_NO_ATTEMPT = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGpipelineStatus {
    PQ_PIPELINE_OFF = 0,
    PQ_PIPELINE_ON = 1,
    PQ_PIPELINE_ABORTED = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PGauthData {
    PQAUTHDATA_PROMPT_OAUTH_DEVICE = 0,
    PQAUTHDATA_OAUTH_BEARER_TOKEN = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pg_conn {
    _unused: [u8; 0],
}
pub type PGconn = pg_conn;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pg_cancel_conn {
    _unused: [u8; 0],
}
pub type PGcancelConn = pg_cancel_conn;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pg_result {
    _unused: [u8; 0],
}
pub type PGresult = pg_result;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pg_cancel {
    _unused: [u8; 0],
}
pub type PGcancel = pg_cancel;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pgNotify {
    pub relname: *mut ::std::os::raw::c_char,
    pub be_pid: ::std::os::raw::c_int,
    pub extra: *mut ::std::os::raw::c_char,
    pub next: *mut pgNotify,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pgNotify"][::std::mem::size_of::<pgNotify>() - 16usize];
    ["Alignment of pgNotify"][::std::mem::align_of::<pgNotify>() - 4usize];
    ["Offset of field: pgNotify::relname"][::std::mem::offset_of!(pgNotify, relname) - 0usize];
    ["Offset of field: pgNotify::be_pid"][::std::mem::offset_of!(pgNotify, be_pid) - 4usize];
    ["Offset of field: pgNotify::extra"][::std::mem::offset_of!(pgNotify, extra) - 8usize];
    ["Offset of field: pgNotify::next"][::std::mem::offset_of!(pgNotify, next) - 12usize];
};
pub type PGnotify = pgNotify;
pub type pg_usec_time_t = i64;
pub type PQnoticeReceiver = ::std::option::Option<
    unsafe extern "C" fn(arg: *mut ::std::os::raw::c_void, res: *const PGresult),
>;
pub type PQnoticeProcessor = ::std::option::Option<
    unsafe extern "C" fn(arg: *mut ::std::os::raw::c_void, message: *const ::std::os::raw::c_char),
>;
pub type pqbool = ::std::os::raw::c_char;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _PQprintOpt {
    pub header: pqbool,
    pub align: pqbool,
    pub standard: pqbool,
    pub html3: pqbool,
    pub expanded: pqbool,
    pub pager: pqbool,
    pub fieldSep: *mut ::std::os::raw::c_char,
    pub tableOpt: *mut ::std::os::raw::c_char,
    pub caption: *mut ::std::os::raw::c_char,
    pub fieldName: *mut *mut ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _PQprintOpt"][::std::mem::size_of::<_PQprintOpt>() - 24usize];
    ["Alignment of _PQprintOpt"][::std::mem::align_of::<_PQprintOpt>() - 4usize];
    ["Offset of field: _PQprintOpt::header"][::std::mem::offset_of!(_PQprintOpt, header) - 0usize];
    ["Offset of field: _PQprintOpt::align"][::std::mem::offset_of!(_PQprintOpt, align) - 1usize];
    ["Offset of field: _PQprintOpt::standard"]
        [::std::mem::offset_of!(_PQprintOpt, standard) - 2usize];
    ["Offset of field: _PQprintOpt::html3"][::std::mem::offset_of!(_PQprintOpt, html3) - 3usize];
    ["Offset of field: _PQprintOpt::expanded"]
        [::std::mem::offset_of!(_PQprintOpt, expanded) - 4usize];
    ["Offset of field: _PQprintOpt::pager"][::std::mem::offset_of!(_PQprintOpt, pager) - 5usize];
    ["Offset of field: _PQprintOpt::fieldSep"]
        [::std::mem::offset_of!(_PQprintOpt, fieldSep) - 8usize];
    ["Offset of field: _PQprintOpt::tableOpt"]
        [::std::mem::offset_of!(_PQprintOpt, tableOpt) - 12usize];
    ["Offset of field: _PQprintOpt::caption"]
        [::std::mem::offset_of!(_PQprintOpt, caption) - 16usize];
    ["Offset of field: _PQprintOpt::fieldName"]
        [::std::mem::offset_of!(_PQprintOpt, fieldName) - 20usize];
};
pub type PQprintOpt = _PQprintOpt;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _PQconninfoOption {
    pub keyword: *mut ::std::os::raw::c_char,
    pub envvar: *mut ::std::os::raw::c_char,
    pub compiled: *mut ::std::os::raw::c_char,
    pub val: *mut ::std::os::raw::c_char,
    pub label: *mut ::std::os::raw::c_char,
    pub dispchar: *mut ::std::os::raw::c_char,
    pub dispsize: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _PQconninfoOption"][::std::mem::size_of::<_PQconninfoOption>() - 28usize];
    ["Alignment of _PQconninfoOption"][::std::mem::align_of::<_PQconninfoOption>() - 4usize];
    ["Offset of field: _PQconninfoOption::keyword"]
        [::std::mem::offset_of!(_PQconninfoOption, keyword) - 0usize];
    ["Offset of field: _PQconninfoOption::envvar"]
        [::std::mem::offset_of!(_PQconninfoOption, envvar) - 4usize];
    ["Offset of field: _PQconninfoOption::compiled"]
        [::std::mem::offset_of!(_PQconninfoOption, compiled) - 8usize];
    ["Offset of field: _PQconninfoOption::val"]
        [::std::mem::offset_of!(_PQconninfoOption, val) - 12usize];
    ["Offset of field: _PQconninfoOption::label"]
        [::std::mem::offset_of!(_PQconninfoOption, label) - 16usize];
    ["Offset of field: _PQconninfoOption::dispchar"]
        [::std::mem::offset_of!(_PQconninfoOption, dispchar) - 20usize];
    ["Offset of field: _PQconninfoOption::dispsize"]
        [::std::mem::offset_of!(_PQconninfoOption, dispsize) - 24usize];
};
pub type PQconninfoOption = _PQconninfoOption;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PQArgBlock {
    pub len: ::std::os::raw::c_int,
    pub isint: ::std::os::raw::c_int,
    pub u: PQArgBlock__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union PQArgBlock__bindgen_ty_1 {
    pub ptr: *mut ::std::os::raw::c_int,
    pub integer: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of PQArgBlock__bindgen_ty_1"]
        [::std::mem::size_of::<PQArgBlock__bindgen_ty_1>() - 4usize];
    ["Alignment of PQArgBlock__bindgen_ty_1"]
        [::std::mem::align_of::<PQArgBlock__bindgen_ty_1>() - 4usize];
    ["Offset of field: PQArgBlock__bindgen_ty_1::ptr"]
        [::std::mem::offset_of!(PQArgBlock__bindgen_ty_1, ptr) - 0usize];
    ["Offset of field: PQArgBlock__bindgen_ty_1::integer"]
        [::std::mem::offset_of!(PQArgBlock__bindgen_ty_1, integer) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of PQArgBlock"][::std::mem::size_of::<PQArgBlock>() - 12usize];
    ["Alignment of PQArgBlock"][::std::mem::align_of::<PQArgBlock>() - 4usize];
    ["Offset of field: PQArgBlock::len"][::std::mem::offset_of!(PQArgBlock, len) - 0usize];
    ["Offset of field: PQArgBlock::isint"][::std::mem::offset_of!(PQArgBlock, isint) - 4usize];
    ["Offset of field: PQArgBlock::u"][::std::mem::offset_of!(PQArgBlock, u) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pgresAttDesc {
    pub name: *mut ::std::os::raw::c_char,
    pub tableid: Oid,
    pub columnid: ::std::os::raw::c_int,
    pub format: ::std::os::raw::c_int,
    pub typid: Oid,
    pub typlen: ::std::os::raw::c_int,
    pub atttypmod: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pgresAttDesc"][::std::mem::size_of::<pgresAttDesc>() - 28usize];
    ["Alignment of pgresAttDesc"][::std::mem::align_of::<pgresAttDesc>() - 4usize];
    ["Offset of field: pgresAttDesc::name"][::std::mem::offset_of!(pgresAttDesc, name) - 0usize];
    ["Offset of field: pgresAttDesc::tableid"]
        [::std::mem::offset_of!(pgresAttDesc, tableid) - 4usize];
    ["Offset of field: pgresAttDesc::columnid"]
        [::std::mem::offset_of!(pgresAttDesc, columnid) - 8usize];
    ["Offset of field: pgresAttDesc::format"]
        [::std::mem::offset_of!(pgresAttDesc, format) - 12usize];
    ["Offset of field: pgresAttDesc::typid"][::std::mem::offset_of!(pgresAttDesc, typid) - 16usize];
    ["Offset of field: pgresAttDesc::typlen"]
        [::std::mem::offset_of!(pgresAttDesc, typlen) - 20usize];
    ["Offset of field: pgresAttDesc::atttypmod"]
        [::std::mem::offset_of!(pgresAttDesc, atttypmod) - 24usize];
};
pub type PGresAttDesc = pgresAttDesc;
unsafe extern "C" {
    pub fn PQconnectStart(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn;
}
unsafe extern "C" {
    pub fn PQconnectStartParams(
        keywords: *const *const ::std::os::raw::c_char,
        values: *const *const ::std::os::raw::c_char,
        expand_dbname: ::std::os::raw::c_int,
    ) -> *mut PGconn;
}
unsafe extern "C" {
    pub fn PQconnectPoll(conn: *mut PGconn) -> PostgresPollingStatusType;
}
unsafe extern "C" {
    pub fn PQconnectdb(conninfo: *const ::std::os::raw::c_char) -> *mut PGconn;
}
unsafe extern "C" {
    pub fn PQconnectdbParams(
        keywords: *const *const ::std::os::raw::c_char,
        values: *const *const ::std::os::raw::c_char,
        expand_dbname: ::std::os::raw::c_int,
    ) -> *mut PGconn;
}
unsafe extern "C" {
    pub fn PQsetdbLogin(
        pghost: *const ::std::os::raw::c_char,
        pgport: *const ::std::os::raw::c_char,
        pgoptions: *const ::std::os::raw::c_char,
        pgtty: *const ::std::os::raw::c_char,
        dbName: *const ::std::os::raw::c_char,
        login: *const ::std::os::raw::c_char,
        pwd: *const ::std::os::raw::c_char,
    ) -> *mut PGconn;
}
unsafe extern "C" {
    pub fn PQfinish(conn: *mut PGconn);
}
unsafe extern "C" {
    pub fn PQconndefaults() -> *mut PQconninfoOption;
}
unsafe extern "C" {
    pub fn PQconninfoParse(
        conninfo: *const ::std::os::raw::c_char,
        errmsg: *mut *mut ::std::os::raw::c_char,
    ) -> *mut PQconninfoOption;
}
unsafe extern "C" {
    pub fn PQconninfo(conn: *mut PGconn) -> *mut PQconninfoOption;
}
unsafe extern "C" {
    pub fn PQconninfoFree(connOptions: *mut PQconninfoOption);
}
unsafe extern "C" {
    pub fn PQresetStart(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQresetPoll(conn: *mut PGconn) -> PostgresPollingStatusType;
}
unsafe extern "C" {
    pub fn PQreset(conn: *mut PGconn);
}
unsafe extern "C" {
    pub fn PQcancelCreate(conn: *mut PGconn) -> *mut PGcancelConn;
}
unsafe extern "C" {
    pub fn PQcancelStart(cancelConn: *mut PGcancelConn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQcancelBlocking(cancelConn: *mut PGcancelConn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQcancelPoll(cancelConn: *mut PGcancelConn) -> PostgresPollingStatusType;
}
unsafe extern "C" {
    pub fn PQcancelStatus(cancelConn: *const PGcancelConn) -> ConnStatusType;
}
unsafe extern "C" {
    pub fn PQcancelSocket(cancelConn: *const PGcancelConn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQcancelErrorMessage(cancelConn: *const PGcancelConn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQcancelReset(cancelConn: *mut PGcancelConn);
}
unsafe extern "C" {
    pub fn PQcancelFinish(cancelConn: *mut PGcancelConn);
}
unsafe extern "C" {
    pub fn PQgetCancel(conn: *mut PGconn) -> *mut PGcancel;
}
unsafe extern "C" {
    pub fn PQfreeCancel(cancel: *mut PGcancel);
}
unsafe extern "C" {
    pub fn PQcancel(
        cancel: *mut PGcancel,
        errbuf: *mut ::std::os::raw::c_char,
        errbufsize: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQrequestCancel(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQdb(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQuser(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQpass(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQhost(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQhostaddr(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQport(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQtty(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQoptions(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQstatus(conn: *const PGconn) -> ConnStatusType;
}
unsafe extern "C" {
    pub fn PQtransactionStatus(conn: *const PGconn) -> PGTransactionStatusType;
}
unsafe extern "C" {
    pub fn PQparameterStatus(
        conn: *const PGconn,
        paramName: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQprotocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQfullProtocolVersion(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQserverVersion(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQerrorMessage(conn: *const PGconn) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQsocket(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQbackendPID(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQpipelineStatus(conn: *const PGconn) -> PGpipelineStatus;
}
unsafe extern "C" {
    pub fn PQconnectionNeedsPassword(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQconnectionUsedPassword(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQconnectionUsedGSSAPI(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQclientEncoding(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsetClientEncoding(
        conn: *mut PGconn,
        encoding: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsslInUse(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsslStruct(
        conn: *mut PGconn,
        struct_name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn PQsslAttribute(
        conn: *mut PGconn,
        attribute_name: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQsslAttributeNames(conn: *mut PGconn) -> *const *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQgetssl(conn: *mut PGconn) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn PQinitSSL(do_init: ::std::os::raw::c_int);
}
unsafe extern "C" {
    pub fn PQinitOpenSSL(do_ssl: ::std::os::raw::c_int, do_crypto: ::std::os::raw::c_int);
}
unsafe extern "C" {
    pub fn PQgssEncInUse(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetgssctx(conn: *mut PGconn) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn PQsetErrorVerbosity(conn: *mut PGconn, verbosity: PGVerbosity) -> PGVerbosity;
}
unsafe extern "C" {
    pub fn PQsetErrorContextVisibility(
        conn: *mut PGconn,
        show_context: PGContextVisibility,
    ) -> PGContextVisibility;
}
unsafe extern "C" {
    pub fn PQsetNoticeReceiver(
        conn: *mut PGconn,
        proc_: PQnoticeReceiver,
        arg: *mut ::std::os::raw::c_void,
    ) -> PQnoticeReceiver;
}
unsafe extern "C" {
    pub fn PQsetNoticeProcessor(
        conn: *mut PGconn,
        proc_: PQnoticeProcessor,
        arg: *mut ::std::os::raw::c_void,
    ) -> PQnoticeProcessor;
}
pub type pgthreadlock_t =
    ::std::option::Option<unsafe extern "C" fn(acquire: ::std::os::raw::c_int)>;
unsafe extern "C" {
    pub fn PQregisterThreadLock(newhandler: pgthreadlock_t) -> pgthreadlock_t;
}
unsafe extern "C" {
    pub fn PQtrace(conn: *mut PGconn, debug_port: *mut FILE);
}
unsafe extern "C" {
    pub fn PQuntrace(conn: *mut PGconn);
}
unsafe extern "C" {
    pub fn PQsetTraceFlags(conn: *mut PGconn, flags: ::std::os::raw::c_int);
}
unsafe extern "C" {
    pub fn PQexec(conn: *mut PGconn, query: *const ::std::os::raw::c_char) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQexecParams(
        conn: *mut PGconn,
        command: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramTypes: *const Oid,
        paramValues: *const *const ::std::os::raw::c_char,
        paramLengths: *const ::std::os::raw::c_int,
        paramFormats: *const ::std::os::raw::c_int,
        resultFormat: ::std::os::raw::c_int,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQprepare(
        conn: *mut PGconn,
        stmtName: *const ::std::os::raw::c_char,
        query: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramTypes: *const Oid,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQexecPrepared(
        conn: *mut PGconn,
        stmtName: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramValues: *const *const ::std::os::raw::c_char,
        paramLengths: *const ::std::os::raw::c_int,
        paramFormats: *const ::std::os::raw::c_int,
        resultFormat: ::std::os::raw::c_int,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQsendQuery(
        conn: *mut PGconn,
        query: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendQueryParams(
        conn: *mut PGconn,
        command: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramTypes: *const Oid,
        paramValues: *const *const ::std::os::raw::c_char,
        paramLengths: *const ::std::os::raw::c_int,
        paramFormats: *const ::std::os::raw::c_int,
        resultFormat: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendPrepare(
        conn: *mut PGconn,
        stmtName: *const ::std::os::raw::c_char,
        query: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramTypes: *const Oid,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendQueryPrepared(
        conn: *mut PGconn,
        stmtName: *const ::std::os::raw::c_char,
        nParams: ::std::os::raw::c_int,
        paramValues: *const *const ::std::os::raw::c_char,
        paramLengths: *const ::std::os::raw::c_int,
        paramFormats: *const ::std::os::raw::c_int,
        resultFormat: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsetSingleRowMode(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsetChunkedRowsMode(
        conn: *mut PGconn,
        chunkSize: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetResult(conn: *mut PGconn) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQisBusy(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQconsumeInput(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQenterPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQexitPipelineMode(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQpipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendFlushRequest(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendPipelineSync(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQnotifies(conn: *mut PGconn) -> *mut PGnotify;
}
unsafe extern "C" {
    pub fn PQputCopyData(
        conn: *mut PGconn,
        buffer: *const ::std::os::raw::c_char,
        nbytes: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQputCopyEnd(
        conn: *mut PGconn,
        errormsg: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetCopyData(
        conn: *mut PGconn,
        buffer: *mut *mut ::std::os::raw::c_char,
        async_: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetline(
        conn: *mut PGconn,
        buffer: *mut ::std::os::raw::c_char,
        length: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQputline(
        conn: *mut PGconn,
        string: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetlineAsync(
        conn: *mut PGconn,
        buffer: *mut ::std::os::raw::c_char,
        bufsize: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQputnbytes(
        conn: *mut PGconn,
        buffer: *const ::std::os::raw::c_char,
        nbytes: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQendcopy(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsetnonblocking(conn: *mut PGconn, arg: ::std::os::raw::c_int)
        -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQisnonblocking(conn: *const PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQisthreadsafe() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQping(conninfo: *const ::std::os::raw::c_char) -> PGPing;
}
unsafe extern "C" {
    pub fn PQpingParams(
        keywords: *const *const ::std::os::raw::c_char,
        values: *const *const ::std::os::raw::c_char,
        expand_dbname: ::std::os::raw::c_int,
    ) -> PGPing;
}
unsafe extern "C" {
    pub fn PQflush(conn: *mut PGconn) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQfn(
        conn: *mut PGconn,
        fnid: ::std::os::raw::c_int,
        result_buf: *mut ::std::os::raw::c_int,
        result_len: *mut ::std::os::raw::c_int,
        result_is_int: ::std::os::raw::c_int,
        args: *const PQArgBlock,
        nargs: ::std::os::raw::c_int,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQresultStatus(res: *const PGresult) -> ExecStatusType;
}
unsafe extern "C" {
    pub fn PQresStatus(status: ExecStatusType) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQresultErrorMessage(res: *const PGresult) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQresultVerboseErrorMessage(
        res: *const PGresult,
        verbosity: PGVerbosity,
        show_context: PGContextVisibility,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQresultErrorField(
        res: *const PGresult,
        fieldcode: ::std::os::raw::c_int,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQntuples(res: *const PGresult) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQnfields(res: *const PGresult) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQbinaryTuples(res: *const PGresult) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQfname(
        res: *const PGresult,
        field_num: ::std::os::raw::c_int,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQfnumber(
        res: *const PGresult,
        field_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQftable(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid;
}
unsafe extern "C" {
    pub fn PQftablecol(
        res: *const PGresult,
        field_num: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQfformat(
        res: *const PGresult,
        field_num: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQftype(res: *const PGresult, field_num: ::std::os::raw::c_int) -> Oid;
}
unsafe extern "C" {
    pub fn PQfsize(res: *const PGresult, field_num: ::std::os::raw::c_int)
        -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQfmod(res: *const PGresult, field_num: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQcmdStatus(res: *mut PGresult) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQoidStatus(res: *const PGresult) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQoidValue(res: *const PGresult) -> Oid;
}
unsafe extern "C" {
    pub fn PQcmdTuples(res: *mut PGresult) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQgetvalue(
        res: *const PGresult,
        tup_num: ::std::os::raw::c_int,
        field_num: ::std::os::raw::c_int,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQgetlength(
        res: *const PGresult,
        tup_num: ::std::os::raw::c_int,
        field_num: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetisnull(
        res: *const PGresult,
        tup_num: ::std::os::raw::c_int,
        field_num: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQnparams(res: *const PGresult) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQparamtype(res: *const PGresult, param_num: ::std::os::raw::c_int) -> Oid;
}
unsafe extern "C" {
    pub fn PQdescribePrepared(
        conn: *mut PGconn,
        stmt: *const ::std::os::raw::c_char,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQdescribePortal(
        conn: *mut PGconn,
        portal: *const ::std::os::raw::c_char,
    ) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQsendDescribePrepared(
        conn: *mut PGconn,
        stmt: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendDescribePortal(
        conn: *mut PGconn,
        portal: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQclosePrepared(conn: *mut PGconn, stmt: *const ::std::os::raw::c_char)
        -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQclosePortal(conn: *mut PGconn, portal: *const ::std::os::raw::c_char)
        -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQsendClosePrepared(
        conn: *mut PGconn,
        stmt: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsendClosePortal(
        conn: *mut PGconn,
        portal: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQclear(res: *mut PGresult);
}
unsafe extern "C" {
    pub fn PQfreemem(ptr: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
    pub fn PQmakeEmptyPGresult(conn: *mut PGconn, status: ExecStatusType) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQcopyResult(src: *const PGresult, flags: ::std::os::raw::c_int) -> *mut PGresult;
}
unsafe extern "C" {
    pub fn PQsetResultAttrs(
        res: *mut PGresult,
        numAttributes: ::std::os::raw::c_int,
        attDescs: *mut PGresAttDesc,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQresultAlloc(res: *mut PGresult, nBytes: usize) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn PQresultMemorySize(res: *const PGresult) -> usize;
}
unsafe extern "C" {
    pub fn PQsetvalue(
        res: *mut PGresult,
        tup_num: ::std::os::raw::c_int,
        field_num: ::std::os::raw::c_int,
        value: *mut ::std::os::raw::c_char,
        len: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQescapeStringConn(
        conn: *mut PGconn,
        to: *mut ::std::os::raw::c_char,
        from: *const ::std::os::raw::c_char,
        length: usize,
        error: *mut ::std::os::raw::c_int,
    ) -> usize;
}
unsafe extern "C" {
    pub fn PQescapeLiteral(
        conn: *mut PGconn,
        str_: *const ::std::os::raw::c_char,
        len: usize,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQescapeIdentifier(
        conn: *mut PGconn,
        str_: *const ::std::os::raw::c_char,
        len: usize,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQescapeByteaConn(
        conn: *mut PGconn,
        from: *const ::std::os::raw::c_uchar,
        from_length: usize,
        to_length: *mut usize,
    ) -> *mut ::std::os::raw::c_uchar;
}
unsafe extern "C" {
    pub fn PQunescapeBytea(
        strtext: *const ::std::os::raw::c_uchar,
        retbuflen: *mut usize,
    ) -> *mut ::std::os::raw::c_uchar;
}
unsafe extern "C" {
    pub fn PQescapeString(
        to: *mut ::std::os::raw::c_char,
        from: *const ::std::os::raw::c_char,
        length: usize,
    ) -> usize;
}
unsafe extern "C" {
    pub fn PQescapeBytea(
        from: *const ::std::os::raw::c_uchar,
        from_length: usize,
        to_length: *mut usize,
    ) -> *mut ::std::os::raw::c_uchar;
}
unsafe extern "C" {
    pub fn PQprint(fout: *mut FILE, res: *const PGresult, po: *const PQprintOpt);
}
unsafe extern "C" {
    pub fn PQdisplayTuples(
        res: *const PGresult,
        fp: *mut FILE,
        fillAlign: ::std::os::raw::c_int,
        fieldSep: *const ::std::os::raw::c_char,
        printHeader: ::std::os::raw::c_int,
        quiet: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn PQprintTuples(
        res: *const PGresult,
        fout: *mut FILE,
        PrintAttNames: ::std::os::raw::c_int,
        TerseOutput: ::std::os::raw::c_int,
        colWidth: ::std::os::raw::c_int,
    );
}
unsafe extern "C" {
    pub fn lo_open(
        conn: *mut PGconn,
        lobjId: Oid,
        mode: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_close(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_read(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        buf: *mut ::std::os::raw::c_char,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_write(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        buf: *const ::std::os::raw::c_char,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_lseek(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        offset: ::std::os::raw::c_int,
        whence: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_lseek64(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        offset: i64,
        whence: ::std::os::raw::c_int,
    ) -> i64;
}
unsafe extern "C" {
    pub fn lo_creat(conn: *mut PGconn, mode: ::std::os::raw::c_int) -> Oid;
}
unsafe extern "C" {
    pub fn lo_create(conn: *mut PGconn, lobjId: Oid) -> Oid;
}
unsafe extern "C" {
    pub fn lo_tell(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_tell64(conn: *mut PGconn, fd: ::std::os::raw::c_int) -> i64;
}
unsafe extern "C" {
    pub fn lo_truncate(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_truncate64(
        conn: *mut PGconn,
        fd: ::std::os::raw::c_int,
        len: i64,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_unlink(conn: *mut PGconn, lobjId: Oid) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn lo_import(conn: *mut PGconn, filename: *const ::std::os::raw::c_char) -> Oid;
}
unsafe extern "C" {
    pub fn lo_import_with_oid(
        conn: *mut PGconn,
        filename: *const ::std::os::raw::c_char,
        lobjId: Oid,
    ) -> Oid;
}
unsafe extern "C" {
    pub fn lo_export(
        conn: *mut PGconn,
        lobjId: Oid,
        filename: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQlibVersion() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQsocketPoll(
        sock: ::std::os::raw::c_int,
        forRead: ::std::os::raw::c_int,
        forWrite: ::std::os::raw::c_int,
        end_time: pg_usec_time_t,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQgetCurrentTimeUSec() -> pg_usec_time_t;
}
unsafe extern "C" {
    pub fn PQmblen(
        s: *const ::std::os::raw::c_char,
        encoding: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQmblenBounded(
        s: *const ::std::os::raw::c_char,
        encoding: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQdsplen(
        s: *const ::std::os::raw::c_char,
        encoding: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn PQenv2encoding() -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _PGpromptOAuthDevice {
    pub verification_uri: *const ::std::os::raw::c_char,
    pub user_code: *const ::std::os::raw::c_char,
    pub verification_uri_complete: *const ::std::os::raw::c_char,
    pub expires_in: ::std::os::raw::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of _PGpromptOAuthDevice"][::std::mem::size_of::<_PGpromptOAuthDevice>() - 16usize];
    ["Alignment of _PGpromptOAuthDevice"][::std::mem::align_of::<_PGpromptOAuthDevice>() - 4usize];
    ["Offset of field: _PGpromptOAuthDevice::verification_uri"]
        [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri) - 0usize];
    ["Offset of field: _PGpromptOAuthDevice::user_code"]
        [::std::mem::offset_of!(_PGpromptOAuthDevice, user_code) - 4usize];
    ["Offset of field: _PGpromptOAuthDevice::verification_uri_complete"]
        [::std::mem::offset_of!(_PGpromptOAuthDevice, verification_uri_complete) - 8usize];
    ["Offset of field: _PGpromptOAuthDevice::expires_in"]
        [::std::mem::offset_of!(_PGpromptOAuthDevice, expires_in) - 12usize];
};
pub type PGpromptOAuthDevice = _PGpromptOAuthDevice;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PGoauthBearerRequest {
    pub openid_configuration: *const ::std::os::raw::c_char,
    pub scope: *const ::std::os::raw::c_char,
    pub async_: ::std::option::Option<
        unsafe extern "C" fn(
            conn: *mut PGconn,
            request: *mut PGoauthBearerRequest,
            altsock: *mut ::std::os::raw::c_int,
        ) -> PostgresPollingStatusType,
    >,
    pub cleanup: ::std::option::Option<
        unsafe extern "C" fn(conn: *mut PGconn, request: *mut PGoauthBearerRequest),
    >,
    pub token: *mut ::std::os::raw::c_char,
    pub user: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of PGoauthBearerRequest"][::std::mem::size_of::<PGoauthBearerRequest>() - 24usize];
    ["Alignment of PGoauthBearerRequest"][::std::mem::align_of::<PGoauthBearerRequest>() - 4usize];
    ["Offset of field: PGoauthBearerRequest::openid_configuration"]
        [::std::mem::offset_of!(PGoauthBearerRequest, openid_configuration) - 0usize];
    ["Offset of field: PGoauthBearerRequest::scope"]
        [::std::mem::offset_of!(PGoauthBearerRequest, scope) - 4usize];
    ["Offset of field: PGoauthBearerRequest::async_"]
        [::std::mem::offset_of!(PGoauthBearerRequest, async_) - 8usize];
    ["Offset of field: PGoauthBearerRequest::cleanup"]
        [::std::mem::offset_of!(PGoauthBearerRequest, cleanup) - 12usize];
    ["Offset of field: PGoauthBearerRequest::token"]
        [::std::mem::offset_of!(PGoauthBearerRequest, token) - 16usize];
    ["Offset of field: PGoauthBearerRequest::user"]
        [::std::mem::offset_of!(PGoauthBearerRequest, user) - 20usize];
};
unsafe extern "C" {
    pub fn PQencryptPassword(
        passwd: *const ::std::os::raw::c_char,
        user: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQencryptPasswordConn(
        conn: *mut PGconn,
        passwd: *const ::std::os::raw::c_char,
        user: *const ::std::os::raw::c_char,
        algorithm: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn PQchangePassword(
        conn: *mut PGconn,
        user: *const ::std::os::raw::c_char,
        passwd: *const ::std::os::raw::c_char,
    ) -> *mut PGresult;
}
pub type PQauthDataHook_type = ::std::option::Option<
    unsafe extern "C" fn(
        type_: PGauthData,
        conn: *mut PGconn,
        data: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
unsafe extern "C" {
    pub fn PQsetAuthDataHook(hook: PQauthDataHook_type);
}
unsafe extern "C" {
    pub fn PQgetAuthDataHook() -> PQauthDataHook_type;
}
unsafe extern "C" {
    pub fn PQdefaultAuthDataHook(
        type_: PGauthData,
        conn: *mut PGconn,
        data: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn pg_char_to_encoding(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn pg_encoding_to_char(encoding: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn pg_valid_server_encoding_id(encoding: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
pub type PQsslKeyPassHook_OpenSSL_type = ::std::option::Option<
    unsafe extern "C" fn(
        buf: *mut ::std::os::raw::c_char,
        size: ::std::os::raw::c_int,
        conn: *mut PGconn,
    ) -> ::std::os::raw::c_int,
>;
unsafe extern "C" {
    pub fn PQgetSSLKeyPassHook_OpenSSL() -> PQsslKeyPassHook_OpenSSL_type;
}
unsafe extern "C" {
    pub fn PQsetSSLKeyPassHook_OpenSSL(hook: PQsslKeyPassHook_OpenSSL_type);
}
unsafe extern "C" {
    pub fn PQdefaultSSLKeyPassHook_OpenSSL(
        buf: *mut ::std::os::raw::c_char,
        size: ::std::os::raw::c_int,
        conn: *mut PGconn,
    ) -> ::std::os::raw::c_int;
}