File: pgsql.php

package info (click to toggle)
codelite 12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (2199 lines) | stat: -rw-r--r-- 78,624 bytes parent folder | download | duplicates (6)
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
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
<?php

// Start of pgsql v.

/**
 * Open a PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-connect.php
 * @param connection_string string <p>
 *       The connection_string can be empty to use all default parameters, or it 
 *       can contain one or more parameter settings separated by whitespace. 
 *       Each parameter setting is in the form keyword = value. Spaces around 
 *       the equal sign are optional. To write an empty value or a value 
 *       containing spaces, surround it with single quotes, e.g., keyword = 
 *       'a value'. Single quotes and backslashes within the value must be 
 *       escaped with a backslash, i.e., \' and \\.  
 *      </p>
 *      <p>
 *       The currently recognized parameter keywords are:
 *       host, hostaddr, port,
 *       dbname (defaults to value of user),
 *       user,
 *       password, connect_timeout,
 *       options, tty (ignored), sslmode,
 *       requiressl (deprecated in favor of sslmode), and
 *       service.  Which of these arguments exist depends
 *       on your PostgreSQL version.
 *      </p>
 *      <p>
 *       The options parameter can be used to set command line parameters 
 *       to be invoked by the server.
 *      </p>
 * @param connect_type int[optional] <p>
 *       If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
 *       is created, even if the connection_string is identical to
 *       an existing connection.
 *      </p>
 *      <p>
 *       If PGSQL_CONNECT_ASYNC is given, then the
 *       connection is established asynchronously. The state of the connection
 *       can then be checked via pg_connect_poll or
 *       pg_connection_status.
 *      </p>
 * @return resource PostgreSQL connection resource on success, false on failure.
 */
function pg_connect ($connection_string, $connect_type = null) {}

/**
 * Open a persistent PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-pconnect.php
 * @param connection_string string <p>
 *       The connection_string can be empty to use all default parameters, or it 
 *       can contain one or more parameter settings separated by whitespace. 
 *       Each parameter setting is in the form keyword = value. Spaces around 
 *       the equal sign are optional. To write an empty value or a value 
 *       containing spaces, surround it with single quotes, e.g., keyword = 
 *       'a value'. Single quotes and backslashes within the value must be 
 *       escaped with a backslash, i.e., \' and \\.  
 *      </p>
 *      <p>
 *       The currently recognized parameter keywords are:
 *       host, hostaddr, port,
 *       dbname, user,
 *       password, connect_timeout,
 *       options, tty (ignored), sslmode,
 *       requiressl (deprecated in favor of sslmode), and
 *       service.  Which of these arguments exist depends
 *       on your PostgreSQL version.
 *      </p>
 * @param connect_type int[optional] <p>
 *       If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
 *       is created, even if the connection_string is identical to
 *       an existing connection.
 *      </p>
 * @return resource PostgreSQL connection resource on success, false on failure.
 */
function pg_pconnect ($connection_string, $connect_type = null) {}

/**
 * Poll the status of an in-progress asynchronous PostgreSQL connection
   attempt.
 * @link http://www.php.net/manual/en/function.pg-connect-poll.php
 * @param connection resource[optional] <p>
 *      PostgreSQL database connection resource.
 *     </p>
 * @return int PGSQL_POLLING_FAILED,
 *   PGSQL_POLLING_READING,
 *   PGSQL_POLLING_WRITING,
 *   PGSQL_POLLING_OK, or
 *   PGSQL_POLLING_ACTIVE.
 */
function pg_connect_poll ($connection = null) {}

/**
 * Closes a PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-close.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_close ($connection = null) {}

/**
 * Get connection status
 * @link http://www.php.net/manual/en/function.pg-connection-status.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return int PGSQL_CONNECTION_OK or 
 *    PGSQL_CONNECTION_BAD.
 */
function pg_connection_status ($connection) {}

/**
 * Get connection is busy or not
 * @link http://www.php.net/manual/en/function.pg-connection-busy.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return bool true if the connection is busy, false otherwise.
 */
function pg_connection_busy ($connection) {}

/**
 * Reset connection (reconnect)
 * @link http://www.php.net/manual/en/function.pg-connection-reset.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_connection_reset ($connection) {}

/**
 * Returns the host name associated with the connection
 * @link http://www.php.net/manual/en/function.pg-host.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string A string containing the name of the host the 
 *   connection is to, or false on error.
 */
function pg_host ($connection = null) {}

/**
 * Get the database name
 * @link http://www.php.net/manual/en/function.pg-dbname.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string A string containing the name of the database the 
 *   connection is to, or false on error.
 */
function pg_dbname ($connection = null) {}

/**
 * Return the port number associated with the connection
 * @link http://www.php.net/manual/en/function.pg-port.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return int An int containing the port number of the database
 *   server the connection is to, 
 *   or false on error.
 */
function pg_port ($connection = null) {}

/**
 * Return the TTY name associated with the connection
 * @link http://www.php.net/manual/en/function.pg-tty.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string A string containing the debug TTY of 
 *   the connection, or false on error.
 */
function pg_tty ($connection = null) {}

/**
 * Get the options associated with the connection
 * @link http://www.php.net/manual/en/function.pg-options.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string A string containing the connection
 *   options, or false on error.
 */
function pg_options ($connection = null) {}

/**
 * Returns an array with client, protocol and server version (when available)
 * @link http://www.php.net/manual/en/function.pg-version.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return array an array with client, protocol 
 *   and server keys and values (if available).  Returns
 *   false on error or invalid connection.
 */
function pg_version ($connection = null) {}

/**
 * Ping database connection
 * @link http://www.php.net/manual/en/function.pg-ping.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_ping ($connection = null) {}

/**
 * Looks up a current parameter setting of the server.
 * @link http://www.php.net/manual/en/function.pg-parameter-status.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param param_name string <p>
 *         Possible param_name values include server_version, 
 *        server_encoding, client_encoding, 
 *        is_superuser, session_authorization, 
 *        DateStyle, TimeZone, and 
 *        integer_datetimes.
 *        </p>
 * @return string A string containing the value of the parameter, false on failure or invalid
 *  param_name.
 */
function pg_parameter_status ($connection = null, $param_name) {}

/**
 * Returns the current in-transaction status of the server.
 * @link http://www.php.net/manual/en/function.pg-transaction-status.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return int The status can be PGSQL_TRANSACTION_IDLE (currently idle),
 *    PGSQL_TRANSACTION_ACTIVE (a command is in progress),
 *    PGSQL_TRANSACTION_INTRANS (idle, in a valid transaction block),
 *    or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block).
 *    PGSQL_TRANSACTION_UNKNOWN is reported if the connection is bad.
 *    PGSQL_TRANSACTION_ACTIVE is reported only when a query
 *    has been sent to the server and not yet completed.
 */
function pg_transaction_status ($connection) {}

/**
 * Execute a query
 * @link http://www.php.net/manual/en/function.pg-query.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param query string <p>
 *       The SQL statement or statements to be executed. When multiple statements are passed to the function,
 *       they are automatically executed as one transaction, unless there are explicit BEGIN/COMMIT commands
 *       included in the query string. However, using multiple transactions in one function call is not recommended.
 *      </p>
 *      
 *       <p>
 *        String interpolation of user-supplied data is extremely dangerous and is
 *        likely to lead to SQL
 *        injection vulnerabilities. In most cases
 *        pg_query_params should be preferred, passing
 *        user-supplied values as parameters rather than substituting them into
 *        the query string.
 *       </p>
 *       <p>
 *        Any user-supplied data substituted directly into a query string should
 *        be properly escaped.
 *       </p>
 * @return resource A query result resource on success&return.falseforfailure;.
 */
function pg_query ($connection = null, $query) {}

/**
 * Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text.
 * @link http://www.php.net/manual/en/function.pg-query-params.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param query string <p>
 *       The parameterized SQL statement.  Must contain only a single statement.
 *       (multiple statements separated by semi-colons are not allowed.)  If any parameters 
 *       are used, they are referred to as $1, $2, etc.
 *      </p>
 *      <p>
 *       User-supplied values should always be passed as parameters, not
 *       interpolated into the query string, where they form possible
 *        SQL injection
 *       attack vectors and introduce bugs when handling data containing quotes.
 *       If for some reason you cannot use a parameter, ensure that interpolated
 *       values are properly escaped.
 *      </p>
 * @param params array <p>
 *        An array of parameter values to substitute for the $1, $2, etc. placeholders
 *        in the original prepared query string.  The number of elements in the array
 *        must match the number of placeholders.
 *      </p>
 *      <p>
 *       Values intended for bytea fields are not supported as
 *       parameters. Use pg_escape_bytea instead, or use the
 *       large object functions.
 *      </p>
 * @return resource A query result resource on success&return.falseforfailure;.
 */
function pg_query_params ($connection = null, $query, array $params) {}

/**
 * Submits a request to create a prepared statement with the 
  given parameters, and waits for completion.
 * @link http://www.php.net/manual/en/function.pg-prepare.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param stmtname string <p>
 *       The name to give the prepared statement.  Must be unique per-connection.  If
 *       "" is specified, then an unnamed statement is created, overwriting any
 *       previously defined unnamed statement.
 *      </p>
 * @param query string <p>
 *       The parameterized SQL statement.  Must contain only a single statement.
 *       (multiple statements separated by semi-colons are not allowed.)  If any parameters 
 *       are used, they are referred to as $1, $2, etc.
 *      </p>
 * @return resource A query result resource on success&return.falseforfailure;.
 */
function pg_prepare ($connection = null, $stmtname, $query) {}

/**
 * Sends a request to execute a prepared statement with given parameters, and waits for the result.
 * @link http://www.php.net/manual/en/function.pg-execute.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param stmtname string <p>
 *       The name of the prepared statement to execute.  if
 *       "" is specified, then the unnamed statement is executed.  The name must have
 *       been previously prepared using pg_prepare, 
 *       pg_send_prepare or a PREPARE SQL
 *       command.
 *      </p>
 * @param params array <p>
 *        An array of parameter values to substitute for the $1, $2, etc. placeholders
 *        in the original prepared query string.  The number of elements in the array
 *        must match the number of placeholders.
 *      </p>
 *      
 *       <p>
 *        Elements are converted to strings by calling this function.
 *       </p>
 * @return resource A query result resource on success&return.falseforfailure;.
 */
function pg_execute ($connection = null, $stmtname, array $params) {}

/**
 * Sends asynchronous query
 * @link http://www.php.net/manual/en/function.pg-send-query.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param query string <p>
 *       The SQL statement or statements to be executed.
 *      </p>
 *      <p>
 *       Data inside the query should be properly escaped.
 *      </p>
 * @return bool Returns true on success, false on failure.</p>
 *  <p>
 *   Use pg_get_result to determine the query result.
 */
function pg_send_query ($connection, $query) {}

/**
 * Submits a command and separate parameters to the server without waiting for the result(s).
 * @link http://www.php.net/manual/en/function.pg-send-query-params.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param query string <p>
 *       The parameterized SQL statement.  Must contain only a single statement.
 *       (multiple statements separated by semi-colons are not allowed.)  If any parameters 
 *       are used, they are referred to as $1, $2, etc.
 *      </p>
 * @param params array <p>
 *        An array of parameter values to substitute for the $1, $2, etc. placeholders
 *        in the original prepared query string.  The number of elements in the array
 *        must match the number of placeholders.
 *      </p>
 * @return bool Returns true on success, false on failure.</p>
 *  <p>
 *   Use pg_get_result to determine the query result.
 */
function pg_send_query_params ($connection, $query, array $params) {}

/**
 * Sends a request to create a prepared statement with the given parameters, without waiting for completion.
 * @link http://www.php.net/manual/en/function.pg-send-prepare.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param stmtname string <p>
 *       The name to give the prepared statement.  Must be unique per-connection.  If
 *       "" is specified, then an unnamed statement is created, overwriting any
 *       previously defined unnamed statement.
 *      </p>
 * @param query string <p>
 *       The parameterized SQL statement.  Must contain only a single statement.
 *       (multiple statements separated by semi-colons are not allowed.)  If any parameters 
 *       are used, they are referred to as $1, $2, etc.
 *      </p>
 * @return bool true on success, false on failure.  Use pg_get_result
 *  to determine the query result.
 */
function pg_send_prepare ($connection, $stmtname, $query) {}

/**
 * Sends a request to execute a prepared statement with given parameters, without waiting for the result(s).
 * @link http://www.php.net/manual/en/function.pg-send-execute.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param stmtname string <p>
 *       The name of the prepared statement to execute.  if
 *       "" is specified, then the unnamed statement is executed.  The name must have
 *       been previously prepared using pg_prepare, 
 *       pg_send_prepare or a PREPARE SQL
 *       command.
 *      </p>
 * @param params array <p>
 *        An array of parameter values to substitute for the $1, $2, etc. placeholders
 *        in the original prepared query string.  The number of elements in the array
 *        must match the number of placeholders.
 *      </p>
 * @return bool true on success, false on failure.  Use pg_get_result
 *  to determine the query result.
 */
function pg_send_execute ($connection, $stmtname, array $params) {}

/**
 * Cancel an asynchronous query
 * @link http://www.php.net/manual/en/function.pg-cancel-query.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_cancel_query ($connection) {}

/**
 * Returns values from a result resource
 * @link http://www.php.net/manual/en/function.pg-fetch-result.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int <p>
 *       Row number in result to fetch.  Rows are numbered from 0 upwards.  If omitted,
 *       next row is fetched.
 *      </p>
 * @param field mixed <p>       
 *       A string representing the name of the field (column) to fetch, otherwise
 *       an int representing the field number to fetch.  Fields are
 *       numbered from 0 upwards.
 *      </p>
 * @return string Boolean is returned as &quot;t&quot; or &quot;f&quot;.  All
 *   other types, including arrays are returned as strings formatted
 *   in the same default PostgreSQL manner that you would see in the
 *   psql program.  Database NULL
 *   values are returned as &null;.
 *  </p>
 *  <p>
 *   false is returned if row exceeds the number
 *   of rows in the set, or on any other error.
 */
function pg_fetch_result ($result, $row, $field) {}

/**
 * Get a row as an enumerated array
 * @link http://www.php.net/manual/en/function.pg-fetch-row.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int[optional] <p>
 *       Row number in result to fetch. Rows are numbered from 0 upwards. If
 *       omitted or &null;, the next row is fetched.
 *      </p>
 * @param result_type int[optional] 
 * @return array An array, indexed from 0 upwards, with each value
 *   represented as a string.  Database NULL
 *   values are returned as &null;.
 *  </p>
 *  <p>
 *   false is returned if row exceeds the number
 *   of rows in the set, there are no more rows, or on any other error.
 */
function pg_fetch_row ($result, $row = null, $result_type = null) {}

/**
 * Fetch a row as an associative array
 * @link http://www.php.net/manual/en/function.pg-fetch-assoc.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int[optional] <p>
 *       Row number in result to fetch. Rows are numbered from 0 upwards. If
 *       omitted or &null;, the next row is fetched.
 *      </p>
 * @return array An array indexed associatively (by field name).
 *   Each value in the array is represented as a 
 *   string.  Database NULL
 *   values are returned as &null;.
 *  </p>
 *  <p>
 *   false is returned if row exceeds the number
 *   of rows in the set, there are no more rows, or on any other error.
 */
function pg_fetch_assoc ($result, $row = null) {}

/**
 * Fetch a row as an array
 * @link http://www.php.net/manual/en/function.pg-fetch-array.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int[optional] <p>
 *       Row number in result to fetch. Rows are numbered from 0 upwards. If
 *       omitted or &null;, the next row is fetched.
 *      </p>
 * @param result_type int[optional] <p>
 *       An optional parameter that controls
 *       how the returned array is indexed.
 *       result_type is a constant and can take the
 *       following values: PGSQL_ASSOC, 
 *       PGSQL_NUM and PGSQL_BOTH.
 *       Using PGSQL_NUM, pg_fetch_array
 *       will return an array with numerical indices, using
 *       PGSQL_ASSOC it will return only associative indices
 *       while PGSQL_BOTH, the default, will return both
 *       numerical and associative indices.
 *      </p>
 * @return array An array indexed numerically (beginning with 0) or
 *   associatively (indexed by field name), or both.
 *   Each value in the array is represented as a 
 *   string.  Database NULL
 *   values are returned as &null;.
 *  </p>
 *  <p>
 *   false is returned if row exceeds the number
 *   of rows in the set, there are no more rows, or on any other error.
 */
function pg_fetch_array ($result, $row = null, $result_type = null) {}

/**
 * Fetch a row as an object
 * @link http://www.php.net/manual/en/function.pg-fetch-object.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int[optional] <p>
 *       Row number in result to fetch. Rows are numbered from 0 upwards. If
 *       omitted or &null;, the next row is fetched.
 *      </p>
 * @param result_type int[optional] <p>
 *        Ignored and deprecated.
 *       </p>
 * @return object An object with one attribute for each field
 *   name in the result.  Database NULL
 *   values are returned as &null;.
 *  </p>
 *  <p>
 *   false is returned if row exceeds the number
 *   of rows in the set, there are no more rows, or on any other error.
 */
function pg_fetch_object ($result, $row = null, $result_type = null) {}

/**
 * Fetches all rows from a result as an array
 * @link http://www.php.net/manual/en/function.pg-fetch-all.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return array An array with all rows in the result.  Each row is an array
 *   of field values indexed by field name.
 *  </p>
 *  <p>
 *   false is returned if there are no rows in the result, or on any
 *   other error.
 */
function pg_fetch_all ($result) {}

/**
 * Fetches all rows in a particular result column as an array
 * @link http://www.php.net/manual/en/function.pg-fetch-all-columns.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param column int[optional] <p>
 *       Column number, zero-based, to be retrieved from the result resource.  Defaults
 *       to the first column if not specified.
 *      </p>
 * @return array An array with all values in the result column.
 *  </p>
 *  <p>
 *   false is returned if column is larger than the number 
 *   of columns in the result, or on any other error.
 */
function pg_fetch_all_columns ($result, $column = null) {}

/**
 * Returns number of affected records (tuples)
 * @link http://www.php.net/manual/en/function.pg-affected-rows.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return int The number of rows affected by the query.  If no tuple is
 *   affected, it will return 0.
 */
function pg_affected_rows ($result) {}

/**
 * Get asynchronous query result
 * @link http://www.php.net/manual/en/function.pg-get-result.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return resource The result resource, or false if no more results are available.
 */
function pg_get_result ($connection = null) {}

/**
 * Set internal row offset in result resource
 * @link http://www.php.net/manual/en/function.pg-result-seek.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param offset int <p>
 *       Row to move the internal offset to in the result resource.
 *       Rows are numbered starting from zero.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_result_seek ($result, $offset) {}

/**
 * Get status of query result
 * @link http://www.php.net/manual/en/function.pg-result-status.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param type int[optional] <p>
 *       Either PGSQL_STATUS_LONG to return the numeric status 
 *       of the result, or PGSQL_STATUS_STRING 
 *       to return the command tag of the result.
 *       If not specified, PGSQL_STATUS_LONG is the default.
 *      </p>
 * @return mixed Possible return values are PGSQL_EMPTY_QUERY,
 *   PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_COPY_OUT,
 *   PGSQL_COPY_IN, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and
 *   PGSQL_FATAL_ERROR if PGSQL_STATUS_LONG is
 *   specified.  Otherwise, a string containing the PostgreSQL command tag is returned.
 */
function pg_result_status ($result, $type = null) {}

/**
 * Free result memory
 * @link http://www.php.net/manual/en/function.pg-free-result.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_free_result ($result) {}

/**
 * Returns the last row's OID
 * @link http://www.php.net/manual/en/function.pg-last-oid.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return string A string containing the OID assigned to the most recently inserted
 *   row in the specified connection, or false on error or
 *   no available OID.
 */
function pg_last_oid ($result) {}

/**
 * Returns the number of rows in a result
 * @link http://www.php.net/manual/en/function.pg-num-rows.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return int The number of rows in the result. On error, -1 is returned.
 */
function pg_num_rows ($result) {}

/**
 * Returns the number of fields in a result
 * @link http://www.php.net/manual/en/function.pg-num-fields.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return int The number of fields (columns) in the result. On error, -1 is returned.
 */
function pg_num_fields ($result) {}

/**
 * Returns the name of a field
 * @link http://www.php.net/manual/en/function.pg-field-name.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_number int <p>
 *        Field number, starting from 0.
 *       </p>
 * @return string The field name, or false on error.
 */
function pg_field_name ($result, $field_number) {}

/**
 * Returns the field number of the named field
 * @link http://www.php.net/manual/en/function.pg-field-num.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_name string <p>
 *        The name of the field.
 *       </p>
 * @return int The field number (numbered from 0), or -1 on error.
 */
function pg_field_num ($result, $field_name) {}

/**
 * Returns the internal storage size of the named field
 * @link http://www.php.net/manual/en/function.pg-field-size.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_number int <p>
 *        Field number, starting from 0.
 *       </p>
 * @return int The internal field storage size (in bytes).  -1 indicates a variable
 *   length field.  false is returned on error.
 */
function pg_field_size ($result, $field_number) {}

/**
 * Returns the type name for the corresponding field number
 * @link http://www.php.net/manual/en/function.pg-field-type.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_number int <p>
 *        Field number, starting from 0.
 *       </p>
 * @return string A string containing the base name of the field's type, or false
 *   on error.
 */
function pg_field_type ($result, $field_number) {}

/**
 * Returns the type ID (OID) for the corresponding field number
 * @link http://www.php.net/manual/en/function.pg-field-type-oid.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_number int <p>
 *        Field number, starting from 0.
 *       </p>
 * @return int The OID of the field's base type. false is returned on error.
 */
function pg_field_type_oid ($result, $field_number) {}

/**
 * Returns the printed length
 * @link http://www.php.net/manual/en/function.pg-field-prtlen.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row_number int 
 * @param field_name_or_number mixed 
 * @return int The field printed length, or false on error.
 */
function pg_field_prtlen ($result, $row_number, $field_name_or_number) {}

/**
 * Test if a field is SQL <literal>NULL</literal>
 * @link http://www.php.net/manual/en/function.pg-field-is-null.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param row int <p>
 *       Row number in result to fetch.  Rows are numbered from 0 upwards.  If omitted,
 *       current row is fetched.
 *      </p>
 * @param field mixed <p>
 *        Field number (starting from 0) as an integer or 
 *        the field name as a string.
 *       </p>
 * @return int 1 if the field in the given row is SQL NULL, 0
 *   if not.  false is returned if the row is out of range, or upon any other error.
 */
function pg_field_is_null ($result, $row, $field) {}

/**
 * Returns the name or oid of the tables field
 * @link http://www.php.net/manual/en/function.pg-field-table.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @param field_number int <p>
 *        Field number, starting from 0.
 *       </p>
 * @param oid_only bool[optional] <p>
 *        By default the tables name that field belongs to is returned but
 *        if oid_only is set to true, then the
 *        oid will instead be returned.
 *       </p>
 * @return mixed On success either the fields table name or oid. Or, false on failure.
 */
function pg_field_table ($result, $field_number, $oid_only = null) {}

/**
 * Gets SQL NOTIFY message
 * @link http://www.php.net/manual/en/function.pg-get-notify.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param result_type int[optional] <p>
 *       An optional parameter that controls
 *       how the returned array is indexed.
 *       result_type is a constant and can take the
 *       following values: PGSQL_ASSOC, 
 *       PGSQL_NUM and PGSQL_BOTH.
 *       Using PGSQL_NUM, pg_get_notify
 *       will return an array with numerical indices, using
 *       PGSQL_ASSOC it will return only associative indices
 *       while PGSQL_BOTH, the default, will return both
 *       numerical and associative indices.
 *      </p>
 * @return array An array containing the NOTIFY message name and backend PID.
 *   Otherwise if no NOTIFY is waiting, then false is returned.
 */
function pg_get_notify ($connection, $result_type = null) {}

/**
 * Get a read only handle to the socket underlying a PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-socket.php
 * @param connection resource <p>
 *      PostgreSQL database connection resource.
 *     </p>
 * @return resource A socket resource on success&return.falseforfailure;.
 */
function pg_socket ($connection) {}

/**
 * Reads input on the connection
 * @link http://www.php.net/manual/en/function.pg-consume-input.php
 * @param connection resource <p>
 *      PostgreSQL database connection resource.
 *     </p>
 * @return bool true if no error occurred, or false if there was an error. Note that
 *   true does not necessarily indicate that input was waiting to be read.
 */
function pg_consume_input ($connection) {}

/**
 * Flush outbound query data on the connection
 * @link http://www.php.net/manual/en/function.pg-flush.php
 * @param connection resource <p>
 *      PostgreSQL database connection resource.
 *     </p>
 * @return mixed true if the flush was successful or no data was waiting to be
 *   flushed, 0 if part of the pending data was flushed but
 *   more remains&return.falseforfailure;.
 */
function pg_flush ($connection) {}

/**
 * Gets the backend's process ID
 * @link http://www.php.net/manual/en/function.pg-get-pid.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return int The backend database process ID.
 */
function pg_get_pid ($connection) {}

/**
 * Get error message associated with result
 * @link http://www.php.net/manual/en/function.pg-result-error.php
 * @param result resource <p>
 *       PostgreSQL query result resource, returned by pg_query,
 *       pg_query_params or pg_execute
 *       (among others).
 *      </p>
 * @return string a string. Returns empty string if there is no error. If there is an error associated with the
 *   result parameter, returns false.
 */
function pg_result_error ($result) {}

/**
 * Returns an individual field of an error report.
 * @link http://www.php.net/manual/en/function.pg-result-error-field.php
 * @param result resource <p>
 *       A PostgreSQL query result resource from a previously executed
 *       statement.
 *      </p>
 * @param fieldcode int <p>
 *         Possible fieldcode values are: PGSQL_DIAG_SEVERITY,
 *         PGSQL_DIAG_SQLSTATE, PGSQL_DIAG_MESSAGE_PRIMARY,
 *         PGSQL_DIAG_MESSAGE_DETAIL,
 *         PGSQL_DIAG_MESSAGE_HINT, PGSQL_DIAG_STATEMENT_POSITION,
 *         PGSQL_DIAG_INTERNAL_POSITION (PostgreSQL 8.0+ only),
 *         PGSQL_DIAG_INTERNAL_QUERY (PostgreSQL 8.0+ only),
 *         PGSQL_DIAG_CONTEXT, PGSQL_DIAG_SOURCE_FILE,
 *         PGSQL_DIAG_SOURCE_LINE or
 *         PGSQL_DIAG_SOURCE_FUNCTION.
 *        </p>
 * @return string A string containing the contents of the error field, &null; if the field does not exist or false
 *  on failure.
 */
function pg_result_error_field ($result, $fieldcode) {}

/**
 * Get the last error message string of a connection
 * @link http://www.php.net/manual/en/function.pg-last-error.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string A string containing the last error message on the 
 *   given connection, or false on error.
 */
function pg_last_error ($connection = null) {}

/**
 * Returns the last notice message from PostgreSQL server
 * @link http://www.php.net/manual/en/function.pg-last-notice.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @return string A string containing the last notice on the 
 *   given connection, or false on error.
 */
function pg_last_notice ($connection) {}

/**
 * Send a NULL-terminated string to PostgreSQL backend
 * @link http://www.php.net/manual/en/function.pg-put-line.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param data string <p>
 *       A line of text to be sent directly to the PostgreSQL backend.  A NULL
 *       terminator is added automatically.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_put_line ($connection = null, $data) {}

/**
 * Sync with PostgreSQL backend
 * @link http://www.php.net/manual/en/function.pg-end-copy.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_end_copy ($connection = null) {}

/**
 * Copy a table to an array
 * @link http://www.php.net/manual/en/function.pg-copy-to.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table from which to copy the data into rows.
 *      </p>
 * @param delimiter string[optional] <p>
 *       The token that separates values for each field in each element of
 *       rows.  Default is TAB.
 *      </p>
 * @param null_as string[optional] <p>
 *       How SQL NULL values are represented in the
 *       rows.  Default is \N ("\\N").
 *      </p>
 * @return array An array with one element for each line of COPY data.
 *    It returns false on failure.
 */
function pg_copy_to ($connection, $table_name, $delimiter = null, $null_as = null) {}

/**
 * Insert records into a table from an array
 * @link http://www.php.net/manual/en/function.pg-copy-from.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table into which to copy the rows.
 *      </p>
 * @param rows array <p>
 *       An array of data to be copied into table_name.
 *       Each value in rows becomes a row in table_name.
 *       Each value in rows should be a delimited string of the values
 *       to insert into each field.  Values should be linefeed terminated.
 *      </p>
 * @param delimiter string[optional] <p>
 *       The token that separates values for each field in each element of
 *       rows.  Default is TAB.
 *      </p>
 * @param null_as string[optional] <p>
 *       How SQL NULL values are represented in the
 *       rows.  Default is \N ("\\N").
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_copy_from ($connection, $table_name, array $rows, $delimiter = null, $null_as = null) {}

/**
 * Enable tracing a PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-trace.php
 * @param pathname string <p>
 *       The full path and file name of the file in which to write the
 *       trace log.  Same as in fopen.
 *      </p>
 * @param mode string[optional] <p>
 *       An optional file access mode, same as for fopen.
 *      </p>
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_trace ($pathname, $mode = null, $connection = null) {}

/**
 * Disable tracing of a PostgreSQL connection
 * @link http://www.php.net/manual/en/function.pg-untrace.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return bool Always returns true.
 */
function pg_untrace ($connection = null) {}

/**
 * Create a large object
 * @link http://www.php.net/manual/en/function.pg-lo-create.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param object_id mixed[optional] <p>
 *       If an object_id is given the function
 *       will try to create a large object with this id, else a free
 *       object id is assigned by the server. The parameter
 *       was added in PHP 5.3 and relies on functionality that first
 *       appeared in PostgreSQL 8.1.
 *      </p>
 * @return int A large object OID or false on error.
 */
function pg_lo_create ($connection = null, $object_id = null) {}

/**
 * Delete a large object
 * @link http://www.php.net/manual/en/function.pg-lo-unlink.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param oid int <p>
 *       The OID of the large object in the database.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_lo_unlink ($connection, $oid) {}

/**
 * Open a large object
 * @link http://www.php.net/manual/en/function.pg-lo-open.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param oid int <p>
 *       The OID of the large object in the database.
 *      </p>
 * @param mode string <p>
 *       Can be either "r" for read-only, "w" for write only or "rw" for read and 
 *       write.
 *      </p>
 * @return resource A large object resource or false on error.
 */
function pg_lo_open ($connection, $oid, $mode) {}

/**
 * Close a large object
 * @link http://www.php.net/manual/en/function.pg-lo-close.php
 * @param large_object resource 
 * @return bool Returns true on success, false on failure.
 */
function pg_lo_close ($large_object) {}

/**
 * Read a large object
 * @link http://www.php.net/manual/en/function.pg-lo-read.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @param len int[optional] <p>
 *       An optional maximum number of bytes to return.
 *      </p>
 * @return string A string containing len bytes from the
 *   large object, or false on error.
 */
function pg_lo_read ($large_object, $len = null) {}

/**
 * Write to a large object
 * @link http://www.php.net/manual/en/function.pg-lo-write.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @param data string <p>
 *       The data to be written to the large object.  If len is
 *       specified and is less than the length of data, only
 *       len bytes will be written.
 *      </p>
 * @param len int[optional] <p>
 *       An optional maximum number of bytes to write.  Must be greater than zero
 *       and no greater than the length of data.  Defaults to
 *       the length of data.
 *      </p>
 * @return int The number of bytes written to the large object, or false on error.
 */
function pg_lo_write ($large_object, $data, $len = null) {}

/**
 * Reads an entire large object and send straight to browser
 * @link http://www.php.net/manual/en/function.pg-lo-read-all.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @return int Number of bytes read or false on error.
 */
function pg_lo_read_all ($large_object) {}

/**
 * Import a large object from file
 * @link http://www.php.net/manual/en/function.pg-lo-import.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param pathname string <p>
 *       The full path and file name of the file on the client
 *       filesystem from which to read the large object data.
 *      </p>
 * @param object_id mixed[optional] <p>
 *       If an object_id is given the function
 *       will try to create a large object with this id, else a free
 *       object id is assigned by the server. The parameter
 *       was added in PHP 5.3 and relies on functionality that first
 *       appeared in PostgreSQL 8.1.
 *      </p>
 * @return int The OID of the newly created large object, or
 *   false on failure.
 */
function pg_lo_import ($connection = null, $pathname, $object_id = null) {}

/**
 * Export a large object to file
 * @link http://www.php.net/manual/en/function.pg-lo-export.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param oid int <p>
 *       The OID of the large object in the database.
 *      </p>
 * @param pathname string <p>
 *       The full path and file name of the file in which to write the
 *       large object on the client filesystem.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_lo_export ($connection = null, $oid, $pathname) {}

/**
 * Seeks position within a large object
 * @link http://www.php.net/manual/en/function.pg-lo-seek.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @param offset int <p>
 *       The number of bytes to seek.
 *      </p>
 * @param whence int[optional] <p>
 *       One of the constants PGSQL_SEEK_SET (seek from object start), 
 *       PGSQL_SEEK_CUR (seek from current position)
 *       or PGSQL_SEEK_END (seek from object end) .
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_lo_seek ($large_object, $offset, $whence = null) {}

/**
 * Returns current seek position a of large object
 * @link http://www.php.net/manual/en/function.pg-lo-tell.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @return int The current seek offset (in number of bytes) from the beginning of the large
 *   object.  If there is an error, the return value is negative.
 */
function pg_lo_tell ($large_object) {}

/**
 * Truncates a large object
 * @link http://www.php.net/manual/en/function.pg-lo-truncate.php
 * @param large_object resource <p>
 *       PostgreSQL large object (LOB) resource, returned by pg_lo_open.
 *      </p>
 * @param size int <p>
 *       The number of bytes to truncate.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function pg_lo_truncate ($large_object, $size) {}

/**
 * Escape a string for query
 * @link http://www.php.net/manual/en/function.pg-escape-string.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param data string <p>
 *       A string containing text to be escaped.
 *      </p>
 * @return string A string containing the escaped data.
 */
function pg_escape_string ($connection = null, $data) {}

/**
 * Escape a string for insertion into a bytea field
 * @link http://www.php.net/manual/en/function.pg-escape-bytea.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param data string <p>
 *       A string containing text or binary data to be inserted into a bytea
 *       column.
 *      </p>
 * @return string A string containing the escaped data.
 */
function pg_escape_bytea ($connection = null, $data) {}

/**
 * Unescape binary for bytea type
 * @link http://www.php.net/manual/en/function.pg-unescape-bytea.php
 * @param data string <p>
 *       A string containing PostgreSQL bytea data to be converted into
 *       a PHP binary string.
 *      </p>
 * @return string A string containing the unescaped data.
 */
function pg_unescape_bytea ($data) {}

/**
 * Escape a literal for insertion into a text field
 * @link http://www.php.net/manual/en/function.pg-escape-literal.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param data string <p>
 *       A string containing text to be escaped.
 *      </p>
 * @return string A string containing the escaped data.
 */
function pg_escape_literal ($connection = null, $data) {}

/**
 * Escape a identifier for insertion into a text field
 * @link http://www.php.net/manual/en/function.pg-escape-identifier.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param data string <p>
 *       A string containing text to be escaped.
 *      </p>
 * @return string A string containing the escaped data.
 */
function pg_escape_identifier ($connection = null, $data) {}

/**
 * Determines the verbosity of messages returned by <function>pg_last_error</function> 
   and <function>pg_result_error</function>.
 * @link http://www.php.net/manual/en/function.pg-set-error-verbosity.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param verbosity int <p>
 *       The required verbosity: PGSQL_ERRORS_TERSE,
 *       PGSQL_ERRORS_DEFAULT
 *       or PGSQL_ERRORS_VERBOSE.
 *      </p>
 * @return int The previous verbosity level: PGSQL_ERRORS_TERSE,
 *   PGSQL_ERRORS_DEFAULT
 *   or PGSQL_ERRORS_VERBOSE.
 */
function pg_set_error_verbosity ($connection = null, $verbosity) {}

/**
 * Gets the client encoding
 * @link http://www.php.net/manual/en/function.pg-client-encoding.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @return string The client encoding, or false on error.
 */
function pg_client_encoding ($connection = null) {}

/**
 * Set the client encoding
 * @link http://www.php.net/manual/en/function.pg-set-client-encoding.php
 * @param connection resource[optional] <p>
 *       PostgreSQL database connection resource.  When 
 *       connection is not present, the default connection 
 *       is used. The default connection is the last connection made by 
 *       pg_connect or pg_pconnect.
 *      </p>
 * @param encoding string <p>
 *       The required client encoding.  One of SQL_ASCII, EUC_JP, 
 *       EUC_CN, EUC_KR, EUC_TW, 
 *       UNICODE, MULE_INTERNAL, LATINX (X=1...9), 
 *       KOI8, WIN, ALT, SJIS, 
 *       BIG5 or WIN1250.
 *      </p>
 *      <p>
 *       The exact list of available encodings depends on your PostgreSQL version, so check your
 *       PostgreSQL manual for a more specific list.
 *      </p>
 * @return int 0 on success or -1 on error.
 */
function pg_set_client_encoding ($connection = null, $encoding) {}

/**
 * Get meta data for table
 * @link http://www.php.net/manual/en/function.pg-meta-data.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       The name of the table.
 *      </p>
 * @param extended bool[optional] <p>
 *       Flag for returning extended meta data. Default to false.
 *      </p>
 * @return array An array of the table definition, or false on error.
 */
function pg_meta_data ($connection, $table_name, $extended = null) {}

/**
 * Convert associative array values into suitable for SQL statement
 * @link http://www.php.net/manual/en/function.pg-convert.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table against which to convert types.
 *      </p>
 * @param assoc_array array <p>
 *       Data to be converted.
 *      </p>
 * @param options int[optional] <p>
 *       Any number of PGSQL_CONV_IGNORE_DEFAULT,
 *       PGSQL_CONV_FORCE_NULL or
 *       PGSQL_CONV_IGNORE_NOT_NULL, combined.
 *      </p>
 * @return array An array of converted values, or false on error.
 */
function pg_convert ($connection, $table_name, array $assoc_array, $options = null) {}

/**
 * Insert array into table
 * @link http://www.php.net/manual/en/function.pg-insert.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table into which to insert rows.  The table table_name must at least 
 *       have as many columns as assoc_array has elements.
 *      </p>
 * @param assoc_array array <p>
 *       An array whose keys are field names in the table table_name,
 *       and whose values are the values of those fields that are to be inserted.
 *      </p>
 * @param options int[optional] <p>
 *       Any number of PGSQL_CONV_OPTS,
 *       PGSQL_DML_NO_CONV,
 *       PGSQL_DML_ESCAPE,
 *       PGSQL_DML_EXEC,
 *       PGSQL_DML_ASYNC or
 *       PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
 *       options then query string is returned. When PGSQL_DML_NO_CONV
 *       or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
 *      </p>
 * @return mixed Returns true on success, false on failure.  Returns string if PGSQL_DML_STRING is passed
 *   via options.
 */
function pg_insert ($connection, $table_name, array $assoc_array, $options = null) {}

/**
 * Update table
 * @link http://www.php.net/manual/en/function.pg-update.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table into which to update rows.
 *      </p>
 * @param data array <p>
 *       An array whose keys are field names in the table table_name,
 *       and whose values are what matched rows are to be updated to.
 *      </p>
 * @param condition array <p>
 *       An array whose keys are field names in the table table_name,
 *       and whose values are the conditions that a row must meet to be updated.
 *      </p>
 * @param options int[optional] <p>
 *       Any number of PGSQL_CONV_FORCE_NULL,
 *       PGSQL_DML_NO_CONV,
 *       PGSQL_DML_ESCAPE,
 *       PGSQL_DML_EXEC,
 *       PGSQL_DML_ASYNC or
 *       PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
 *       options then query string is returned. When PGSQL_DML_NO_CONV
 *       or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
 *      </p>
 * @return mixed Returns true on success, false on failure.  Returns string if PGSQL_DML_STRING is passed
 *   via options.
 */
function pg_update ($connection, $table_name, array $data, array $condition, $options = null) {}

/**
 * Deletes records
 * @link http://www.php.net/manual/en/function.pg-delete.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table from which to delete rows.
 *      </p>
 * @param assoc_array array <p>
 *       An array whose keys are field names in the table table_name,
 *       and whose values are the values of those fields that are to be deleted.
 *      </p>
 * @param options int[optional] <p>
 *       Any number of PGSQL_CONV_FORCE_NULL,
 *       PGSQL_DML_NO_CONV,
 *       PGSQL_DML_ESCAPE,
 *       PGSQL_DML_EXEC,
 *       PGSQL_DML_ASYNC or
 *       PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
 *       options then query string is returned. When PGSQL_DML_NO_CONV
 *       or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
 *      </p>
 * @return mixed Returns true on success, false on failure.  Returns string if PGSQL_DML_STRING is passed
 *   via options.
 */
function pg_delete ($connection, $table_name, array $assoc_array, $options = null) {}

/**
 * Select records
 * @link http://www.php.net/manual/en/function.pg-select.php
 * @param connection resource <p>
 *       PostgreSQL database connection resource.
 *      </p>
 * @param table_name string <p>
 *       Name of the table from which to select rows.
 *      </p>
 * @param assoc_array array <p>
 *       An array whose keys are field names in the table table_name,
 *       and whose values are the conditions that a row must meet to be retrieved.
 *      </p>
 * @param options int[optional] <p>
 *       Any number of PGSQL_CONV_FORCE_NULL,
 *       PGSQL_DML_NO_CONV,
 *       PGSQL_DML_ESCAPE,
 *       PGSQL_DML_EXEC,
 *       PGSQL_DML_ASYNC or
 *       PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
 *       options then query string is returned. When PGSQL_DML_NO_CONV
 *       or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
 *      </p>
 * @return mixed Returns true on success, false on failure.  Returns string if PGSQL_DML_STRING is passed
 *   via options.
 */
function pg_select ($connection, $table_name, array $assoc_array, $options = null) {}

/**
 * @param connection[optional]
 * @param query[optional]
 */
function pg_exec ($connection, $query) {}

/**
 * @param result
 */
function pg_getlastoid ($result) {}

/**
 * @param result
 */
function pg_cmdtuples ($result) {}

/**
 * @param connection[optional]
 */
function pg_errormessage ($connection) {}

/**
 * @param result
 */
function pg_numrows ($result) {}

/**
 * @param result
 */
function pg_numfields ($result) {}

/**
 * @param result
 * @param field_number
 */
function pg_fieldname ($result, $field_number) {}

/**
 * @param result
 * @param field_number
 */
function pg_fieldsize ($result, $field_number) {}

/**
 * @param result
 * @param field_number
 */
function pg_fieldtype ($result, $field_number) {}

/**
 * @param result
 * @param field_name
 */
function pg_fieldnum ($result, $field_name) {}

/**
 * @param result
 * @param row[optional]
 * @param field_name_or_number[optional]
 */
function pg_fieldprtlen ($result, $row, $field_name_or_number) {}

/**
 * @param result
 * @param row[optional]
 * @param field_name_or_number[optional]
 */
function pg_fieldisnull ($result, $row, $field_name_or_number) {}

/**
 * @param result
 */
function pg_freeresult ($result) {}

/**
 * @param connection
 */
function pg_result ($connection) {}

/**
 * @param large_object
 */
function pg_loreadall ($large_object) {}

/**
 * @param connection[optional]
 * @param large_object_id[optional]
 */
function pg_locreate ($connection, $large_object_id) {}

/**
 * @param connection[optional]
 * @param large_object_oid[optional]
 */
function pg_lounlink ($connection, $large_object_oid) {}

/**
 * @param connection[optional]
 * @param large_object_oid[optional]
 * @param mode[optional]
 */
function pg_loopen ($connection, $large_object_oid, $mode) {}

/**
 * @param large_object
 */
function pg_loclose ($large_object) {}

/**
 * @param large_object
 * @param len[optional]
 */
function pg_loread ($large_object, $len) {}

/**
 * @param large_object
 * @param buf
 * @param len[optional]
 */
function pg_lowrite ($large_object, $buf, $len) {}

/**
 * @param connection[optional]
 * @param filename[optional]
 * @param large_object_oid[optional]
 */
function pg_loimport ($connection, $filename, $large_object_oid) {}

/**
 * @param connection[optional]
 * @param objoid[optional]
 * @param filename[optional]
 */
function pg_loexport ($connection, $objoid, $filename) {}

/**
 * @param connection[optional]
 */
function pg_clientencoding ($connection) {}

/**
 * @param connection[optional]
 * @param encoding[optional]
 */
function pg_setclientencoding ($connection, $encoding) {}


/**
 * Short libpq version that contains only numbers and dots.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_LIBPQ_VERSION', "8.4.17");

/**
 * Long libpq version that includes compiler information.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_LIBPQ_VERSION_STR', "PostgreSQL 8.4.17 on x86_64-unknown-linux-gnu, compiled by GCC gcc (Debian 4.4.5-8) 4.4.5, 64-bit");

/**
 * Passed to pg_connect to force the creation of a new connection,
 *      rather than re-using an existing identical connection.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONNECT_FORCE_NEW', 2);

/**
 * Passed to pg_connect to create an asynchronous
 *      connection. Added in PHP 5.6.0.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONNECT_ASYNC', 4);

/**
 * Passed to pg_fetch_array. Return an associative array of field
 *      names and values.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_ASSOC', 1);

/**
 * Passed to pg_fetch_array. Return a numerically indexed array of field
 *      numbers and values.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_NUM', 2);

/**
 * Passed to pg_fetch_array. Return an array of field values
 *      that is both numerically indexed (by field number) and associated (by field name).
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_BOTH', 3);

/**
 * Returned by pg_connection_status indicating that the database
 *      connection is in an invalid state.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONNECTION_BAD', 1);

/**
 * Returned by pg_connection_status indicating that the database
 *      connection is in a valid state.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONNECTION_OK', 0);
define ('PGSQL_CONNECTION_STARTED', 2);
define ('PGSQL_CONNECTION_MADE', 3);
define ('PGSQL_CONNECTION_AWAITING_RESPONSE', 4);
define ('PGSQL_CONNECTION_AUTH_OK', 5);
define ('PGSQL_CONNECTION_SETENV', 6);

/**
 * Returned by pg_connect_poll to indicate that the
 *     connection attempt failed.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_POLLING_FAILED', 0);

/**
 * Returned by pg_connect_poll to indicate that the
 *     connection is waiting for the PostgreSQL socket to be readable.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_POLLING_READING', 1);

/**
 * Returned by pg_connect_poll to indicate that the
 *     connection is waiting for the PostgreSQL socket to be writable.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_POLLING_WRITING', 2);

/**
 * Returned by pg_connect_poll to indicate that the
 *     connection is ready to be used.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_POLLING_OK', 3);

/**
 * Returned by pg_connect_poll to indicate that the
 *     connection is currently active.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_POLLING_ACTIVE', 4);

/**
 * Returned by pg_transaction_status. Connection is
 *     currently idle, not in a transaction.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TRANSACTION_IDLE', 0);

/**
 * Returned by pg_transaction_status. A command
 *     is in progress on the connection.  A query has been sent via the connection
 *     and not yet completed.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TRANSACTION_ACTIVE', 1);

/**
 * Returned by pg_transaction_status. The connection
 *     is idle, in a transaction block.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TRANSACTION_INTRANS', 2);

/**
 * Returned by pg_transaction_status. The connection
 *     is idle, in a failed transaction block.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TRANSACTION_INERROR', 3);

/**
 * Returned by pg_transaction_status. The connection
 *     is bad.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TRANSACTION_UNKNOWN', 4);

/**
 * Passed to pg_set_error_verbosity.
 *     Specified that returned messages include severity, primary text, 
 *     and position only; this will normally fit on a single line.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_ERRORS_TERSE', 0);

/**
 * Passed to pg_set_error_verbosity.
 *     The default mode produces messages that include the above 
 *     plus any detail, hint, or context fields (these may span 
 *     multiple lines).
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_ERRORS_DEFAULT', 1);

/**
 * Passed to pg_set_error_verbosity.
 *     The verbose mode includes all available fields.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_ERRORS_VERBOSE', 2);

/**
 * Passed to pg_lo_seek. Seek operation is to begin
 *     from the start of the object.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_SEEK_SET', 0);

/**
 * Passed to pg_lo_seek. Seek operation is to begin
 *     from the current position.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_SEEK_CUR', 1);

/**
 * Passed to pg_lo_seek. Seek operation is to begin
 *     from the end of the object.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_SEEK_END', 2);

/**
 * Passed to pg_result_status.  Indicates that
 *     numerical result code is desired.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_STATUS_LONG', 1);

/**
 * Passed to pg_result_status.  Indicates that
 *     textual result command tag is desired.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_STATUS_STRING', 2);

/**
 * Returned by pg_result_status. The string sent to the server
 *     was empty.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_EMPTY_QUERY', 0);

/**
 * Returned by pg_result_status. Successful completion of a 
 *     command returning no data.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_COMMAND_OK', 1);

/**
 * Returned by pg_result_status. Successful completion of a command 
 *     returning data (such as a SELECT or SHOW).
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_TUPLES_OK', 2);

/**
 * Returned by pg_result_status. Copy Out (from server) data 
 *     transfer started.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_COPY_OUT', 3);

/**
 * Returned by pg_result_status. Copy In (to server) data 
 *     transfer started.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_COPY_IN', 4);

/**
 * Returned by pg_result_status. The server's response 
 *     was not understood.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_BAD_RESPONSE', 5);

/**
 * Returned by pg_result_status. A nonfatal error 
 *     (a notice or warning) occurred.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_NONFATAL_ERROR', 6);

/**
 * Returned by pg_result_status. A fatal error 
 *     occurred.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_FATAL_ERROR', 7);

/**
 * Passed to pg_result_error_field.
 *     The severity; the field contents are ERROR, 
 *     FATAL, or PANIC (in an error message), or 
 *     WARNING, NOTICE, DEBUG, 
 *     INFO, or LOG (in a notice message), or a localized 
 *     translation of one of these. Always present.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_SEVERITY', 83);

/**
 * Passed to pg_result_error_field.
 *     The SQLSTATE code for the error. The SQLSTATE code identifies the type of error 
 *     that has occurred; it can be used by front-end applications to perform specific 
 *     operations (such as error handling) in response to a particular database error. 
 *     This field is not localizable, and is always present.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_SQLSTATE', 67);

/**
 * Passed to pg_result_error_field.
 *     The primary human-readable error message (typically one line). Always present.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_MESSAGE_PRIMARY', 77);

/**
 * Passed to pg_result_error_field.
 *     Detail: an optional secondary error message carrying more detail about the problem. May run to multiple lines.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_MESSAGE_DETAIL', 68);

/**
 * Passed to pg_result_error_field.
 *     Hint: an optional suggestion what to do about the problem. This is intended to differ from detail in that it
 *     offers advice (potentially inappropriate) rather than hard facts. May run to multiple lines.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_MESSAGE_HINT', 72);

/**
 * Passed to pg_result_error_field.
 *     A string containing a decimal integer indicating an error cursor position as an index into the original 
 *     statement string. The first character has index 1, and positions are measured in characters not bytes.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_STATEMENT_POSITION', 80);

/**
 * Passed to pg_result_error_field.
 *     This is defined the same as the PG_DIAG_STATEMENT_POSITION field, but 
 *     it is used when the cursor position refers to an internally generated 
 *     command rather than the one submitted by the client. The 
 *     PG_DIAG_INTERNAL_QUERY field will always appear when this 
 *     field appears.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_INTERNAL_POSITION', 112);

/**
 * Passed to pg_result_error_field.
 *     The text of a failed internally-generated command. This could be, for example, a 
 *     SQL query issued by a PL/pgSQL function.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_INTERNAL_QUERY', 113);

/**
 * Passed to pg_result_error_field.
 *     An indication of the context in which the error occurred. Presently 
 *     this includes a call stack traceback of active procedural language 
 *     functions and internally-generated queries. The trace is one entry 
 *     per line, most recent first.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_CONTEXT', 87);

/**
 * Passed to pg_result_error_field.
 *     The file name of the PostgreSQL source-code location where the error 
 *     was reported.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_SOURCE_FILE', 70);

/**
 * Passed to pg_result_error_field.
 *     The line number of the PostgreSQL source-code location where the 
 *     error was reported.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_SOURCE_LINE', 76);

/**
 * Passed to pg_result_error_field.
 *     The name of the PostgreSQL source-code function reporting the error.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DIAG_SOURCE_FUNCTION', 82);

/**
 * Passed to pg_convert.
 *     Ignore default values in the table during conversion.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONV_IGNORE_DEFAULT', 2);

/**
 * Passed to pg_convert.
 *     Use SQL NULL in place of an empty string.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONV_FORCE_NULL', 4);

/**
 * Passed to pg_convert.
 *     Ignore conversion of &null; into SQL NOT NULL columns.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_CONV_IGNORE_NOT_NULL', 8);

/**
 * Passed to pg_insert, pg_select,
 *     pg_update and pg_delete.
 *     Apply escape to all parameters instead of calling pg_convert
 *     internally. This option omits meta data look up. Query could be as fast as
 *     pg_query and pg_send_query.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DML_ESCAPE', 4096);

/**
 * Passed to pg_insert, pg_select,
 *     pg_update and pg_delete.
 *     All parameters passed as is. Manual escape is required
 *     if parameters contain user supplied data. Use pg_escape_string
 *     for it.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DML_NO_CONV', 256);

/**
 * Passed to pg_insert, pg_select,
 *     pg_update and pg_delete.
 *     Execute query by these functions.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DML_EXEC', 512);

/**
 * Passed to pg_insert, pg_select,
 *     pg_update and pg_delete.
 *     Execute asynchronous query by these functions.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DML_ASYNC', 1024);

/**
 * Passed to pg_insert, pg_select,
 *     pg_update and pg_delete.
 *     Return executed query string.
 * @link http://www.php.net/manual/en/pgsql.constants.php
 */
define ('PGSQL_DML_STRING', 2048);

// End of pgsql v.
?>