summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/system-views.sgml
blob: 39815d5faf627b214d04d8d776ae4aea0995ed39 (plain)
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
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
<!-- doc/src/sgml/system-views.sgml -->
<!--
 Documentation of the system views, directed toward PostgreSQL developers
 -->

<chapter id="views">
 <title>System Views</title>

  <para>
   In addition to the system catalogs, <productname>PostgreSQL</productname>
   provides a number of built-in views.  Some system views provide convenient
   access to some commonly used queries on the system catalogs.  Other views
   provide access to internal server state.
  </para>

  <para>
   The information schema (<xref linkend="information-schema"/>) provides
   an alternative set of views which overlap the functionality of the system
   views.  Since the information schema is SQL-standard whereas the views
   described here are <productname>PostgreSQL</productname>-specific,
   it's usually better to use the information schema if it provides all
   the information you need.
  </para>

  <para>
   <xref linkend="view-table"/> lists the system views described here.
   More detailed documentation of each view follows below.
   There are some additional views that provide access to accumulated
   statistics; they are described in
   <xref linkend="monitoring-stats-views-table"/>.
  </para>

 <sect1 id="views-overview">
  <title>Overview</title>

  <para>
   <xref linkend="view-table"/> lists the system views.
   More detailed documentation of each catalog follows below.
   Except where noted, all the views described here are read-only.
  </para>

  <table id="view-table">
   <title>System Views</title>

   <tgroup cols="2">
    <thead>
     <row>
      <entry>View Name</entry>
      <entry>Purpose</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><link linkend="view-pg-available-extensions"><structname>pg_available_extensions</structname></link></entry>
      <entry>available extensions</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-available-extension-versions"><structname>pg_available_extension_versions</structname></link></entry>
      <entry>available versions of extensions</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-backend-memory-contexts"><structname>pg_backend_memory_contexts</structname></link></entry>
      <entry>backend memory contexts</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-config"><structname>pg_config</structname></link></entry>
      <entry>compile-time configuration parameters</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-cursors"><structname>pg_cursors</structname></link></entry>
      <entry>open cursors</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link></entry>
      <entry>summary of configuration file contents</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-group"><structname>pg_group</structname></link></entry>
      <entry>groups of database users</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-hba-file-rules"><structname>pg_hba_file_rules</structname></link></entry>
      <entry>summary of client authentication configuration file contents</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-ident-file-mappings"><structname>pg_ident_file_mappings</structname></link></entry>
      <entry>summary of client user name mapping configuration file contents</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-indexes"><structname>pg_indexes</structname></link></entry>
      <entry>indexes</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-locks"><structname>pg_locks</structname></link></entry>
      <entry>locks currently held or awaited</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-matviews"><structname>pg_matviews</structname></link></entry>
      <entry>materialized views</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-policies"><structname>pg_policies</structname></link></entry>
      <entry>policies</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link></entry>
      <entry>prepared statements</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link></entry>
      <entry>prepared transactions</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-publication-tables"><structname>pg_publication_tables</structname></link></entry>
      <entry>publications and information of their associated tables</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-replication-origin-status"><structname>pg_replication_origin_status</structname></link></entry>
      <entry>information about replication origins, including replication progress</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-replication-slots"><structname>pg_replication_slots</structname></link></entry>
      <entry>replication slot information</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-roles"><structname>pg_roles</structname></link></entry>
      <entry>database roles</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-rules"><structname>pg_rules</structname></link></entry>
      <entry>rules</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-seclabels"><structname>pg_seclabels</structname></link></entry>
      <entry>security labels</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-sequences"><structname>pg_sequences</structname></link></entry>
      <entry>sequences</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-settings"><structname>pg_settings</structname></link></entry>
      <entry>parameter settings</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-shadow"><structname>pg_shadow</structname></link></entry>
      <entry>database users</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-shmem-allocations"><structname>pg_shmem_allocations</structname></link></entry>
      <entry>shared memory allocations</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-stats"><structname>pg_stats</structname></link></entry>
      <entry>planner statistics</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-stats-ext"><structname>pg_stats_ext</structname></link></entry>
      <entry>extended planner statistics</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-stats-ext-exprs"><structname>pg_stats_ext_exprs</structname></link></entry>
      <entry>extended planner statistics for expressions</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-tables"><structname>pg_tables</structname></link></entry>
      <entry>tables</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link></entry>
      <entry>time zone abbreviations</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-timezone-names"><structname>pg_timezone_names</structname></link></entry>
      <entry>time zone names</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-user"><structname>pg_user</structname></link></entry>
      <entry>database users</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link></entry>
      <entry>user mappings</entry>
     </row>

     <row>
      <entry><link linkend="view-pg-views"><structname>pg_views</structname></link></entry>
      <entry>views</entry>
     </row>

    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="view-pg-available-extensions">
  <title><structname>pg_available_extensions</structname></title>

  <indexterm zone="view-pg-available-extensions">
   <primary>pg_available_extensions</primary>
  </indexterm>

  <para>
   The <structname>pg_available_extensions</structname> view lists the
   extensions that are available for installation.
   See also the
   <link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
   catalog, which shows the extensions currently installed.
  </para>

  <table>
   <title><structname>pg_available_extensions</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>name</type>
      </para>
      <para>
       Extension name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>default_version</structfield> <type>text</type>
      </para>
      <para>
       Name of default version, or <literal>NULL</literal> if none is
       specified
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>installed_version</structfield> <type>text</type>
      </para>
      <para>
       Currently installed version of the extension,
       or <literal>NULL</literal> if not installed
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>comment</structfield> <type>text</type>
      </para>
      <para>
       Comment string from the extension's control file
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_available_extensions</structname> view is read-only.
  </para>
 </sect1>

 <sect1 id="view-pg-available-extension-versions">
  <title><structname>pg_available_extension_versions</structname></title>

  <indexterm zone="view-pg-available-extension-versions">
   <primary>pg_available_extension_versions</primary>
  </indexterm>

  <para>
   The <structname>pg_available_extension_versions</structname> view lists the
   specific extension versions that are available for installation.
   See also the <link
   linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
   catalog, which shows the extensions currently installed.
  </para>

  <table>
   <title><structname>pg_available_extension_versions</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>name</type>
      </para>
      <para>
       Extension name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>version</structfield> <type>text</type>
      </para>
      <para>
       Version name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>installed</structfield> <type>bool</type>
      </para>
      <para>
       True if this version of this extension is currently
       installed
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>superuser</structfield> <type>bool</type>
      </para>
      <para>
       True if only superusers are allowed to install this extension
       (but see <structfield>trusted</structfield>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>trusted</structfield> <type>bool</type>
      </para>
      <para>
       True if the extension can be installed by non-superusers
       with appropriate privileges
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relocatable</structfield> <type>bool</type>
      </para>
      <para>
       True if extension can be relocated to another schema
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schema</structfield> <type>name</type>
      </para>
      <para>
       Name of the schema that the extension must be installed into,
       or <literal>NULL</literal> if partially or fully relocatable
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>requires</structfield> <type>name[]</type>
      </para>
      <para>
       Names of prerequisite extensions,
       or <literal>NULL</literal> if none
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>comment</structfield> <type>text</type>
      </para>
      <para>
       Comment string from the extension's control file
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_available_extension_versions</structname> view is
   read-only.
  </para>
 </sect1>

 <sect1 id="view-pg-backend-memory-contexts">
  <title><structname>pg_backend_memory_contexts</structname></title>

  <indexterm zone="view-pg-backend-memory-contexts">
   <primary>pg_backend_memory_contexts</primary>
  </indexterm>

  <para>
   The view <structname>pg_backend_memory_contexts</structname> displays all
   the memory contexts of the server process attached to the current session.
  </para>
  <para>
   <structname>pg_backend_memory_contexts</structname> contains one row
   for each memory context.
  </para>

  <table>
   <title><structname>pg_backend_memory_contexts</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       Name of the memory context
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>ident</structfield> <type>text</type>
      </para>
      <para>
       Identification information of the memory context. This field is truncated at 1024 bytes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>parent</structfield> <type>text</type>
      </para>
      <para>
       Name of the parent of this memory context
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>level</structfield> <type>int4</type>
      </para>
      <para>
       Distance from TopMemoryContext in context tree
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>total_bytes</structfield> <type>int8</type>
      </para>
      <para>
       Total bytes allocated for this memory context
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>total_nblocks</structfield> <type>int8</type>
      </para>
      <para>
       Total number of blocks allocated for this memory context
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>free_bytes</structfield> <type>int8</type>
      </para>
      <para>
       Free space in bytes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>free_chunks</structfield> <type>int8</type>
      </para>
      <para>
       Total number of free chunks
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>used_bytes</structfield> <type>int8</type>
      </para>
      <para>
       Used space in bytes
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   By default, the <structname>pg_backend_memory_contexts</structname> view can be
   read only by superusers or roles with the privileges of the
   <literal>pg_read_all_stats</literal> role.
  </para>
 </sect1>

 <sect1 id="view-pg-config">
  <title><structname>pg_config</structname></title>

  <indexterm zone="view-pg-config">
   <primary>pg_config</primary>
  </indexterm>

  <para>
   The view <structname>pg_config</structname> describes the
   compile-time configuration parameters of the currently installed
   version of <productname>PostgreSQL</productname>. It is intended, for example, to
   be used by software packages that want to interface to
   <productname>PostgreSQL</productname> to facilitate finding the required header
   files and libraries. It provides the same basic information as the
   <xref linkend="app-pgconfig"/> <productname>PostgreSQL</productname> client
   application.
  </para>

  <para>
   By default, the <structname>pg_config</structname> view can be read
   only by superusers.
  </para>

  <table>
   <title><structname>pg_config</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       The parameter name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>setting</structfield> <type>text</type>
      </para>
      <para>
       The parameter value
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-cursors">
  <title><structname>pg_cursors</structname></title>

  <indexterm zone="view-pg-cursors">
   <primary>pg_cursors</primary>
  </indexterm>

  <para>
   The <structname>pg_cursors</structname> view lists the cursors that
   are currently available. Cursors can be defined in several ways:
   <itemizedlist>
    <listitem>
     <para>
      via the <link linkend="sql-declare"><command>DECLARE</command></link>
      statement in SQL
     </para>
    </listitem>

    <listitem>
     <para>
      via the Bind message in the frontend/backend protocol, as
      described in <xref linkend="protocol-flow-ext-query"/>
     </para>
    </listitem>

    <listitem>
     <para>
      via the Server Programming Interface (SPI), as described in
      <xref linkend="spi-interface"/>
     </para>
    </listitem>
   </itemizedlist>

   The <structname>pg_cursors</structname> view displays cursors
   created by any of these means. Cursors only exist for the duration
   of the transaction that defines them, unless they have been
   declared <literal>WITH HOLD</literal>. Therefore non-holdable
   cursors are only present in the view until the end of their
   creating transaction.

   <note>
    <para>
     Cursors are used internally to implement some of the components
     of <productname>PostgreSQL</productname>, such as procedural languages.
     Therefore, the <structname>pg_cursors</structname> view might include cursors
     that have not been explicitly created by the user.
    </para>
   </note>
  </para>

  <table>
   <title><structname>pg_cursors</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       The name of the cursor
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statement</structfield> <type>text</type>
      </para>
      <para>
       The verbatim query string submitted to declare this cursor
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_holdable</structfield> <type>bool</type>
      </para>
      <para>
       <literal>true</literal> if the cursor is holdable (that is, it
       can be accessed after the transaction that declared the cursor
       has committed); <literal>false</literal> otherwise
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_binary</structfield> <type>bool</type>
      </para>
      <para>
       <literal>true</literal> if the cursor was declared
       <literal>BINARY</literal>; <literal>false</literal>
       otherwise
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_scrollable</structfield> <type>bool</type>
      </para>
      <para>
       <literal>true</literal> if the cursor is scrollable (that is, it
       allows rows to be retrieved in a nonsequential manner);
       <literal>false</literal> otherwise
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>creation_time</structfield> <type>timestamptz</type>
      </para>
      <para>
       The time at which the cursor was declared
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_cursors</structname> view is read-only.
  </para>

 </sect1>

 <sect1 id="view-pg-file-settings">
  <title><structname>pg_file_settings</structname></title>

  <indexterm zone="view-pg-file-settings">
   <primary>pg_file_settings</primary>
  </indexterm>

  <para>
   The view <structname>pg_file_settings</structname> provides a summary of
   the contents of the server's configuration file(s).  A row appears in
   this view for each <quote>name = value</quote> entry appearing in the files,
   with annotations indicating whether the value could be applied
   successfully.  Additional row(s) may appear for problems not linked to
   a <quote>name = value</quote> entry, such as syntax errors in the files.
  </para>

  <para>
   This view is helpful for checking whether planned changes in the
   configuration files will work, or for diagnosing a previous failure.
   Note that this view reports on the <emphasis>current</emphasis> contents of the
   files, not on what was last applied by the server.  (The
   <link linkend="view-pg-settings"><structname>pg_settings</structname></link>
   view is usually sufficient to determine that.)
  </para>

  <para>
   By default, the <structname>pg_file_settings</structname> view can be read
   only by superusers.
  </para>

  <table>
   <title><structname>pg_file_settings</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sourcefile</structfield> <type>text</type>
      </para>
      <para>
       Full path name of the configuration file
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sourceline</structfield> <type>int4</type>
      </para>
      <para>
       Line number within the configuration file where the entry appears
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>seqno</structfield> <type>int4</type>
      </para>
      <para>
       Order in which the entries are processed (1..<replaceable>n</replaceable>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       Configuration parameter name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>setting</structfield> <type>text</type>
      </para>
      <para>
       Value to be assigned to the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>applied</structfield> <type>bool</type>
      </para>
      <para>
       True if the value can be applied successfully
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>error</structfield> <type>text</type>
      </para>
      <para>
       If not null, an error message indicating why this entry could
       not be applied
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   If the configuration file contains syntax errors or invalid parameter
   names, the server will not attempt to apply any settings from it, and
   therefore all the <structfield>applied</structfield> fields will read as false.
   In such a case there will be one or more rows with
   non-null <structfield>error</structfield> fields indicating the
   problem(s).  Otherwise, individual settings will be applied if possible.
   If an individual setting cannot be applied (e.g., invalid value, or the
   setting cannot be changed after server start) it will have an appropriate
   message in the <structfield>error</structfield> field.  Another way that
   an entry might have <structfield>applied</structfield> = false is that it is
   overridden by a later entry for the same parameter name; this case is not
   considered an error so nothing appears in
   the <structfield>error</structfield> field.
  </para>

  <para>
   See <xref linkend="config-setting"/> for more information about the various
   ways to change run-time parameters.
  </para>

</sect1>

 <sect1 id="view-pg-group">
  <title><structname>pg_group</structname></title>

  <indexterm zone="view-pg-group">
   <primary>pg_group</primary>
  </indexterm>

  <!-- Unlike information_schema.applicable_roles, this shows no members for
       pg_database_owner.  The v8.1 catalog would have shown no members if
       that role had existed at the time. -->
  <para>
   The view <structname>pg_group</structname> exists for backwards
   compatibility: it emulates a catalog that existed in
   <productname>PostgreSQL</productname> before version 8.1.
   It shows the names and members of all roles that are marked as not
   <structfield>rolcanlogin</structfield>, which is an approximation to the set
   of roles that are being used as groups.
  </para>

  <table>
   <title><structname>pg_group</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>groname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of the group
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>grosysid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       ID of this group
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>grolist</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       An array containing the IDs of the roles in this group
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-hba-file-rules">
  <title><structname>pg_hba_file_rules</structname></title>

  <indexterm zone="view-pg-hba-file-rules">
   <primary>pg_hba_file_rules</primary>
  </indexterm>

  <para>
   The view <structname>pg_hba_file_rules</structname> provides a summary of
   the contents of the client authentication configuration file,
   <link linkend="auth-pg-hba-conf"><filename>pg_hba.conf</filename></link>.
   A row appears in this view for each
   non-empty, non-comment line in the file, with annotations indicating
   whether the rule could be applied successfully.
  </para>

  <para>
   This view can be helpful for checking whether planned changes in the
   authentication configuration file will work, or for diagnosing a previous
   failure.  Note that this view reports on the <emphasis>current</emphasis> contents
   of the file, not on what was last loaded by the server.
  </para>

  <para>
   By default, the <structname>pg_hba_file_rules</structname> view can be read
   only by superusers.
  </para>

  <table>
   <title><structname>pg_hba_file_rules</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rule_number</structfield> <type>int4</type>
      </para>
      <para>
       Number of this rule, if valid, otherwise <literal>NULL</literal>.
       This indicates the order in which each rule is considered
       until a match is found during authentication.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>file_name</structfield> <type>text</type>
      </para>
      <para>
       Name of the file containing this rule
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>line_number</structfield> <type>int4</type>
      </para>
      <para>
       Line number of this rule in <literal>file_name</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>type</structfield> <type>text</type>
      </para>
      <para>
       Type of connection
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>database</structfield> <type>text[]</type>
      </para>
      <para>
       List of database name(s) to which this rule applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>user_name</structfield> <type>text[]</type>
      </para>
      <para>
       List of user and group name(s) to which this rule applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>address</structfield> <type>text</type>
      </para>
      <para>
       Host name or IP address, or one
       of <literal>all</literal>, <literal>samehost</literal>,
       or <literal>samenet</literal>, or null for local connections
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>netmask</structfield> <type>text</type>
      </para>
      <para>
       IP address mask, or null if not applicable
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>auth_method</structfield> <type>text</type>
      </para>
      <para>
       Authentication method
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>options</structfield> <type>text[]</type>
      </para>
      <para>
       Options specified for authentication method, if any
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>error</structfield> <type>text</type>
      </para>
      <para>
       If not null, an error message indicating why this
       line could not be processed
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Usually, a row reflecting an incorrect entry will have values for only
   the <structfield>line_number</structfield> and <structfield>error</structfield> fields.
  </para>

  <para>
   See <xref linkend="client-authentication"/> for more information about
   client authentication configuration.
  </para>
 </sect1>

 <sect1 id="view-pg-ident-file-mappings">
  <title><structname>pg_ident_file_mappings</structname></title>

  <indexterm zone="view-pg-ident-file-mappings">
   <primary>pg_ident_file_mappings</primary>
  </indexterm>

  <para>
   The view <structname>pg_ident_file_mappings</structname> provides a summary
   of the contents of the client user name mapping configuration file,
   <link linkend="auth-username-maps"><filename>pg_ident.conf</filename></link>.
   A row appears in this view for each non-empty, non-comment line in the file,
   with annotations indicating whether the map could be applied successfully.
  </para>

  <para>
   This view can be helpful for checking whether planned changes in the
   authentication configuration file will work, or for diagnosing a previous
   failure.  Note that this view reports on the <emphasis>current</emphasis>
   contents of the file, not on what was last loaded by the server.
  </para>

  <para>
   By default, the <structname>pg_ident_file_mappings</structname> view can be
   read only by superusers.
  </para>

  <table>
   <title><structname>pg_ident_file_mappings</structname> Columns</title> <tgroup
   cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>map_number</structfield> <type>int4</type>
      </para>
      <para>
       Number of this map, in priority order, if valid, otherwise
       <literal>NULL</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>file_name</structfield> <type>text</type>
      </para>
      <para>
       Name of the file containing this map
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>line_number</structfield> <type>int4</type>
      </para>
      <para>
       Line number of this map in <literal>file_name</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>map_name</structfield> <type>text</type>
      </para>
      <para>
       Name of the map
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sys_name</structfield> <type>text</type>
      </para>
      <para>
       Detected user name of the client
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pg_username</structfield> <type>text</type>
      </para>
      <para>
       Requested PostgreSQL user name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>error</structfield> <type>text</type>
      </para>
      <para>
       If not <literal>NULL</literal>, an error message indicating why this
       line could not be processed
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Usually, a row reflecting an incorrect entry will have values for only
   the <structfield>line_number</structfield> and <structfield>error</structfield> fields.
  </para>

  <para>
   See <xref linkend="client-authentication"/> for more information about
   client authentication configuration.
  </para>
 </sect1>

 <sect1 id="view-pg-indexes">
  <title><structname>pg_indexes</structname></title>

  <indexterm zone="view-pg-indexes">
   <primary>pg_indexes</primary>
  </indexterm>

  <para>
   The view <structname>pg_indexes</structname> provides access to
   useful information about each index in the database.
  </para>

  <table>
   <title><structname>pg_indexes</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table and index
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table the index is for
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>indexname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of index
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablespace</structfield> <type>name</type>
       (references <link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.<structfield>spcname</structfield>)
      </para>
      <para>
       Name of tablespace containing index (null if default for database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>indexdef</structfield> <type>text</type>
      </para>
      <para>
       Index definition (a reconstructed <xref linkend="sql-createindex"/>
       command)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-locks">
  <title><structname>pg_locks</structname></title>

  <indexterm zone="view-pg-locks">
   <primary>pg_locks</primary>
  </indexterm>

  <para>
   The view <structname>pg_locks</structname> provides access to
   information about the locks held by active processes within the
   database server.  See <xref linkend="mvcc"/> for more discussion
   of locking.
  </para>

  <para>
   <structname>pg_locks</structname> contains one row per active lockable
   object, requested lock mode, and relevant process.  Thus, the same
   lockable object might
   appear many times, if multiple processes are holding or waiting
   for locks on it.  However, an object that currently has no locks on it
   will not appear at all.
  </para>

  <para>
   There are several distinct types of lockable objects:
   whole relations (e.g., tables), individual pages of relations,
   individual tuples of relations,
   transaction IDs (both virtual and permanent IDs),
   and general database objects (identified by class OID and object OID,
   in the same way as in <link linkend="catalog-pg-description"><structname>pg_description</structname></link> or
   <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>).  Also, the right to extend a
   relation is represented as a separate lockable object, as is the right to
   update <structname>pg_database</structname>.<structfield>datfrozenxid</structfield>.
   Also, <quote>advisory</quote> locks can be taken on numbers that have
   user-defined meanings.
  </para>

  <table>
   <title><structname>pg_locks</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>locktype</structfield> <type>text</type>
      </para>
      <para>
       Type of the lockable object:
       <literal>relation</literal>,
       <literal>extend</literal>,
       <literal>frozenid</literal>,
       <literal>page</literal>,
       <literal>tuple</literal>,
       <literal>transactionid</literal>,
       <literal>virtualxid</literal>,
       <literal>spectoken</literal>,
       <literal>object</literal>,
       <literal>userlock</literal>,
       <literal>advisory</literal>, or
       <literal>applytransaction</literal>.
       (See also <xref linkend="wait-event-lock-table"/>.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>database</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the database in which the lock target exists, or
       zero if the target is a shared object, or
       null if the target is a transaction ID
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relation</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the relation targeted by the lock, or null if the target is not
       a relation or part of a relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>page</structfield> <type>int4</type>
      </para>
      <para>
       Page number targeted by the lock within the relation,
       or null if the target is not a relation page or tuple
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tuple</structfield> <type>int2</type>
      </para>
      <para>
       Tuple number targeted by the lock within the page,
       or null if the target is not a tuple
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>virtualxid</structfield> <type>text</type>
      </para>
      <para>
       Virtual ID of the transaction targeted by the lock,
       or null if the target is not a virtual transaction ID;  see
       <xref linkend="transactions"/>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>transactionid</structfield> <type>xid</type>
      </para>
      <para>
       ID of the transaction targeted by the lock, or null if the target
       is not a transaction ID;  <xref linkend="transactions"/>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the system catalog containing the lock target, or null if the
       target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       OID of the lock target within its system catalog, or null if the
       target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objsubid</structfield> <type>int2</type>
      </para>
      <para>
       Column number targeted by the lock (the
       <structfield>classid</structfield> and <structfield>objid</structfield> refer to the
       table itself),
       or zero if the target is some other general database object,
       or null if the target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>virtualtransaction</structfield> <type>text</type>
      </para>
      <para>
       Virtual ID of the transaction that is holding or awaiting this lock
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pid</structfield> <type>int4</type>
      </para>
      <para>
       Process ID of the server process holding or awaiting this
       lock, or null if the lock is held by a prepared transaction
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>mode</structfield> <type>text</type>
      </para>
      <para>
       Name of the lock mode held or desired by this process (see <xref linkend="locking-tables"/> and <xref linkend="xact-serializable"/>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>granted</structfield> <type>bool</type>
      </para>
      <para>
       True if lock is held, false if lock is awaited
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>fastpath</structfield> <type>bool</type>
      </para>
      <para>
       True if lock was taken via fast path, false if taken via main
       lock table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>waitstart</structfield> <type>timestamptz</type>
      </para>
      <para>
       Time when the server process started waiting for this lock,
       or null if the lock is held.
       Note that this can be null for a very short period of time after
       the wait started even though <structfield>granted</structfield>
       is <literal>false</literal>.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   <structfield>granted</structfield> is true in a row representing a lock
   held by the indicated process.  False indicates that this process is
   currently waiting to acquire this lock, which implies that at least one
   other process is holding or waiting for a conflicting lock mode on the same
   lockable object.  The waiting process will sleep until the other lock is
   released (or a deadlock situation is detected).  A single process can be
   waiting to acquire at most one lock at a time.
  </para>

  <para>
   Throughout running a transaction, a server process holds an exclusive lock
   on the transaction's virtual transaction ID.  If a permanent ID is assigned
   to the transaction (which normally happens only if the transaction changes
   the state of the database), it also holds an exclusive lock on the
   transaction's permanent transaction ID until it ends.  When a process finds
   it necessary to wait specifically for another transaction to end, it does
   so by attempting to acquire share lock on the other transaction's ID
   (either virtual or permanent ID depending on the situation). That will
   succeed only when the other transaction terminates and releases its locks.
  </para>

  <para>
   Although tuples are a lockable type of object,
   information about row-level locks is stored on disk, not in memory,
   and therefore row-level locks normally do not appear in this view.
   If a process is waiting for a
   row-level lock, it will usually appear in the view as waiting for the
   permanent transaction ID of the current holder of that row lock.
  </para>

  <para>
   A speculative insertion lock consists of a transaction ID and a speculative
   insertion token. The speculative insertion token is displayed in the
   <structfield>objid</structfield> column.
  </para>

  <para>
   Advisory locks can be acquired on keys consisting of either a single
   <type>bigint</type> value or two integer values.
   A <type>bigint</type> key is displayed with its
   high-order half in the <structfield>classid</structfield> column, its low-order half
   in the <structfield>objid</structfield> column, and <structfield>objsubid</structfield> equal
   to 1. The original <type>bigint</type> value can be reassembled with the
   expression <literal>(classid::bigint &lt;&lt; 32) |
   objid::bigint</literal>. Integer keys are displayed with the
   first key in the
   <structfield>classid</structfield> column, the second key in the <structfield>objid</structfield>
   column, and <structfield>objsubid</structfield> equal to 2.  The actual meaning of
   the keys is up to the user.  Advisory locks are local to each database,
   so the <structfield>database</structfield> column is meaningful for an advisory lock.
  </para>

  <para>
   Apply transaction locks are used in parallel mode to apply the transaction
   in logical replication. The remote transaction ID is displayed in the
   <structfield>transactionid</structfield> column. The <structfield>objsubid</structfield>
   displays the lock subtype which is 0 for the lock used to synchronize the
   set of changes, and 1 for the lock used to wait for the transaction to
   finish to ensure commit order.
  </para>

  <para>
   <structname>pg_locks</structname> provides a global view of all locks
   in the database cluster, not only those relevant to the current database.
   Although its <structfield>relation</structfield> column can be joined
   against <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield> to identify locked
   relations, this will only work correctly for relations in the current
   database (those for which the <structfield>database</structfield> column
   is either the current database's OID or zero).
  </para>

  <para>
   The <structfield>pid</structfield> column can be joined to the
   <structfield>pid</structfield> column of the
   <link linkend="monitoring-pg-stat-activity-view">
   <structname>pg_stat_activity</structname></link>
   view to get more
   information on the session holding or awaiting each lock,
   for example
<programlisting>
SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa
    ON pl.pid = psa.pid;
</programlisting>
   Also, if you are using prepared transactions, the
   <structfield>virtualtransaction</structfield> column can be joined to the
   <structfield>transaction</structfield> column of the <link
   linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link>
   view to get more information on prepared transactions that hold locks.
   (A prepared transaction can never be waiting for a lock,
   but it continues to hold the locks it acquired while running.)
   For example:
<programlisting>
SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
    ON pl.virtualtransaction = '-1/' || ppx.transaction;
</programlisting>
  </para>

  <para>
   While it is possible to obtain information about which processes block
   which other processes by joining <structname>pg_locks</structname> against
   itself, this is very difficult to get right in detail.  Such a query would
   have to encode knowledge about which lock modes conflict with which
   others.  Worse, the <structname>pg_locks</structname> view does not expose
   information about which processes are ahead of which others in lock wait
   queues, nor information about which processes are parallel workers running
   on behalf of which other client sessions.  It is better to use
   the <function>pg_blocking_pids()</function> function
   (see <xref linkend="functions-info-session-table"/>) to identify which
   process(es) a waiting process is blocked behind.
  </para>

  <para>
   The <structname>pg_locks</structname> view displays data from both the
   regular lock manager and the predicate lock manager, which are
   separate systems; in addition, the regular lock manager subdivides its
   locks into regular and <firstterm>fast-path</firstterm> locks.
   This data is not guaranteed to be entirely consistent.
   When the view is queried,
   data on fast-path locks (with <structfield>fastpath</structfield> = <literal>true</literal>)
   is gathered from each backend one at a time, without freezing the state of
   the entire lock manager, so it is possible for locks to be taken or
   released while information is gathered.  Note, however, that these locks are
   known not to conflict with any other lock currently in place.  After
   all backends have been queried for fast-path locks, the remainder of the
   regular lock manager is locked as a unit, and a consistent snapshot of all
   remaining locks is collected as an atomic action.  After unlocking the
   regular lock manager, the predicate lock manager is similarly locked and all
   predicate locks are collected as an atomic action.  Thus, with the exception
   of fast-path locks, each lock manager will deliver a consistent set of
   results, but as we do not lock both lock managers simultaneously, it is
   possible for locks to be taken or released after we interrogate the regular
   lock manager and before we interrogate the predicate lock manager.
  </para>

  <para>
   Locking the regular and/or predicate lock manager could have some
   impact on database performance if this view is very frequently accessed.
   The locks are held only for the minimum amount of time necessary to
   obtain data from the lock managers, but this does not completely eliminate
   the possibility of a performance impact.
  </para>

 </sect1>

 <sect1 id="view-pg-matviews">
  <title><structname>pg_matviews</structname></title>

  <indexterm zone="view-pg-matviews">
   <primary>pg_matviews</primary>
  </indexterm>

  <indexterm zone="view-pg-matviews">
   <primary>materialized views</primary>
  </indexterm>

  <para>
   The view <structname>pg_matviews</structname> provides access to
   useful information about each materialized view in the database.
  </para>

  <table>
   <title><structname>pg_matviews</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing materialized view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>matviewname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of materialized view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>matviewowner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of materialized view's owner
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablespace</structfield> <type>name</type>
       (references <link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.<structfield>spcname</structfield>)
      </para>
      <para>
       Name of tablespace containing materialized view (null if default for database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hasindexes</structfield> <type>bool</type>
      </para>
      <para>
       True if materialized view has (or recently had) any indexes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>ispopulated</structfield> <type>bool</type>
      </para>
      <para>
       True if materialized view is currently populated
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>definition</structfield> <type>text</type>
      </para>
      <para>
       Materialized view definition (a reconstructed <xref linkend="sql-select"/> query)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-policies">
  <title><structname>pg_policies</structname></title>

  <indexterm zone="view-pg-policies">
   <primary>pg_policies</primary>
  </indexterm>

  <para>
   The view <structname>pg_policies</structname> provides access to
   useful information about each row-level security policy in the database.
  </para>

  <table>
   <title><structname>pg_policies</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table policy is on
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table policy is on
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>policyname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link>.<structfield>polname</structfield>)
      </para>
      <para>
       Name of policy
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>permissive</structfield> <type>text</type>
      </para>
      <para>
       Is the policy permissive or restrictive?
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>roles</structfield> <type>name[]</type>
      </para>
      <para>
       The roles to which this policy applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>cmd</structfield> <type>text</type>
      </para>
      <para>
       The command type to which the policy is applied
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>qual</structfield> <type>text</type>
      </para>
      <para>
       The expression added to the security barrier qualifications for
       queries that this policy applies to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>with_check</structfield> <type>text</type>
      </para>
      <para>
       The expression added to the WITH CHECK qualifications for
       queries that attempt to add rows to this table
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-prepared-statements">
  <title><structname>pg_prepared_statements</structname></title>

  <indexterm zone="view-pg-prepared-statements">
   <primary>pg_prepared_statements</primary>
  </indexterm>

  <para>
   The <structname>pg_prepared_statements</structname> view displays
   all the prepared statements that are available in the current
   session. See <xref linkend="sql-prepare"/> for more information about prepared
   statements.
  </para>

  <para>
   <structname>pg_prepared_statements</structname> contains one row
   for each prepared statement. Rows are added to the view when a new
   prepared statement is created and removed when a prepared statement
   is released (for example, via the <link linkend="sql-deallocate"><command>DEALLOCATE</command></link> command).
  </para>

  <table>
   <title><structname>pg_prepared_statements</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       The identifier of the prepared statement
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statement</structfield> <type>text</type>
      </para>
      <para>
       The query string submitted by the client to create this
       prepared statement. For prepared statements created via SQL,
       this is the <command>PREPARE</command> statement submitted by
       the client. For prepared statements created via the
       frontend/backend protocol, this is the text of the prepared
       statement itself.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>prepare_time</structfield> <type>timestamptz</type>
      </para>
      <para>
       The time at which the prepared statement was created
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>parameter_types</structfield> <type>regtype[]</type>
      </para>
      <para>
       The expected parameter types for the prepared statement in the
       form of an array of <type>regtype</type>. The OID corresponding
       to an element of this array can be obtained by casting the
       <type>regtype</type> value to <type>oid</type>.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>result_types</structfield> <type>regtype[]</type>
      </para>
      <para>
       The types of the columns returned by the prepared statement in the
       form of an array of <type>regtype</type>. The OID corresponding
       to an element of this array can be obtained by casting the
       <type>regtype</type> value to <type>oid</type>.
       If the prepared statement does not provide a result (e.g., a DML
       statement), then this field will be null.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>from_sql</structfield> <type>bool</type>
      </para>
      <para>
       <literal>true</literal> if the prepared statement was created
       via the <command>PREPARE</command> SQL command;
       <literal>false</literal> if the statement was prepared via the
       frontend/backend protocol
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>generic_plans</structfield> <type>int8</type>
      </para>
      <para>
       Number of times generic plan was chosen
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>custom_plans</structfield> <type>int8</type>
      </para>
      <para>
       Number of times custom plan was chosen
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_prepared_statements</structname> view is read-only.
  </para>
 </sect1>

 <sect1 id="view-pg-prepared-xacts">
  <title><structname>pg_prepared_xacts</structname></title>

  <indexterm zone="view-pg-prepared-xacts">
   <primary>pg_prepared_xacts</primary>
  </indexterm>

  <para>
   The view <structname>pg_prepared_xacts</structname> displays
   information about transactions that are currently prepared for two-phase
   commit (see <xref linkend="sql-prepare-transaction"/> for details).
  </para>

  <para>
   <structname>pg_prepared_xacts</structname> contains one row per prepared
   transaction.  An entry is removed when the transaction is committed or
   rolled back.
  </para>

  <table>
   <title><structname>pg_prepared_xacts</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>transaction</structfield> <type>xid</type>
      </para>
      <para>
       Numeric transaction identifier of the prepared transaction
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>gid</structfield> <type>text</type>
      </para>
      <para>
       Global transaction identifier that was assigned to the transaction
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>prepared</structfield> <type>timestamptz</type>
      </para>
      <para>
       Time at which the transaction was prepared for commit
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>owner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of the user that executed the transaction
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>database</structfield> <type>name</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>datname</structfield>)
      </para>
      <para>
       Name of the database in which the transaction was executed
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   When the <structname>pg_prepared_xacts</structname> view is accessed, the
   internal transaction manager data structures are momentarily locked, and
   a copy is made for the view to display.  This ensures that the
   view produces a consistent set of results, while not blocking
   normal operations longer than necessary.  Nonetheless
   there could be some impact on database performance if this view is
   frequently accessed.
  </para>

 </sect1>

 <sect1 id="view-pg-publication-tables">
  <title><structname>pg_publication_tables</structname></title>

  <indexterm zone="view-pg-publication-tables">
   <primary>pg_publication_tables</primary>
  </indexterm>

  <para>
   The view <structname>pg_publication_tables</structname> provides
   information about the mapping between publications and information of
   tables they contain.  Unlike the underlying catalog
   <link linkend="catalog-pg-publication-rel"><structname>pg_publication_rel</structname></link>,
   this view expands publications defined as
   <link linkend="sql-createpublication-for-all-tables"><literal>FOR ALL TABLES</literal></link>
   and <link linkend="sql-createpublication-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA</literal></link>,
   so for such publications there will be a row for each eligible table.
  </para>

  <table>
   <title><structname>pg_publication_tables</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pubname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-publication"><structname>pg_publication</structname></link>.<structfield>pubname</structfield>)
      </para>
      <para>
       Name of publication
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>attnames</structfield> <type>name[]</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attname</structfield>)
      </para>
      <para>
       Names of table columns included in the publication. This contains all
       the columns of the table when the user didn't specify the column list
       for the table.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rowfilter</structfield> <type>text</type>
      </para>
      <para>
       Expression for the table's publication qualifying condition
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

  <sect1 id="view-pg-replication-origin-status">
  <title><structname>pg_replication_origin_status</structname></title>

  <indexterm zone="view-pg-replication-origin-status">
   <primary>pg_replication_origin_status</primary>
  </indexterm>

  <para>
   The <structname>pg_replication_origin_status</structname> view
   contains information about how far replay for a certain origin has
   progressed.  For more on replication origins
   see <xref linkend="replication-origins"/>.
  </para>

  <table>
   <title><structname>pg_replication_origin_status</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>local_id</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.<structfield>roident</structfield>)
      </para>
      <para>
       internal node identifier
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>external_id</structfield> <type>text</type>
       (references <link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.<structfield>roname</structfield>)
      </para>
      <para>
       external node identifier
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>remote_lsn</structfield> <type>pg_lsn</type>
      </para>
      <para>
       The origin node's LSN up to which data has been replicated.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>local_lsn</structfield> <type>pg_lsn</type>
      </para>
      <para>
       This node's LSN at which <literal>remote_lsn</literal> has
       been replicated. Used to flush commit records before persisting
       data to disk when using asynchronous commits.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="view-pg-replication-slots">
  <title><structname>pg_replication_slots</structname></title>

  <indexterm zone="view-pg-replication-slots">
   <primary>pg_replication_slots</primary>
  </indexterm>

  <para>
   The <structname>pg_replication_slots</structname> view provides a listing
   of all replication slots that currently exist on the database cluster,
   along with their current state.
  </para>

  <para>
   For more on replication slots,
   see <xref linkend="streaming-replication-slots"/> and <xref linkend="logicaldecoding"/>.
  </para>

  <table>
   <title><structname>pg_replication_slots</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>slot_name</structfield> <type>name</type>
      </para>
      <para>
       A unique, cluster-wide identifier for the replication slot
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>plugin</structfield> <type>name</type>
      </para>
      <para>
       The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>slot_type</structfield> <type>text</type>
      </para>
      <para>
       The slot type: <literal>physical</literal> or <literal>logical</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>datoid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the database this slot is associated with, or
       null. Only logical slots have an associated database.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>database</structfield> <type>name</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>datname</structfield>)
      </para>
      <para>
       The name of the database this slot is associated with, or
       null. Only logical slots have an associated database.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>temporary</structfield> <type>bool</type>
      </para>
      <para>
       True if this is a temporary replication slot. Temporary slots are
       not saved to disk and are automatically dropped on error or when
       the session has finished.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>active</structfield> <type>bool</type>
      </para>
      <para>
       True if this slot is currently actively being used
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>active_pid</structfield> <type>int4</type>
      </para>
      <para>
       The process ID of the session using this slot if the slot
       is currently actively being used. <literal>NULL</literal> if
       inactive.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>xmin</structfield> <type>xid</type>
      </para>
      <para>
       The oldest transaction that this slot needs the database to
       retain.  <literal>VACUUM</literal> cannot remove tuples deleted
       by any later transaction.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>catalog_xmin</structfield> <type>xid</type>
      </para>
      <para>
       The oldest transaction affecting the system catalogs that this
       slot needs the database to retain.  <literal>VACUUM</literal> cannot
       remove catalog tuples deleted by any later transaction.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>restart_lsn</structfield> <type>pg_lsn</type>
      </para>
      <para>
       The address (<literal>LSN</literal>) of oldest WAL which still
       might be required by the consumer of this slot and thus won't be
       automatically removed during checkpoints unless this LSN
       gets behind more than <xref linkend="guc-max-slot-wal-keep-size"/>
       from the current LSN.  <literal>NULL</literal>
       if the <literal>LSN</literal> of this slot has never been reserved.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>confirmed_flush_lsn</structfield> <type>pg_lsn</type>
      </para>
      <para>
       The address (<literal>LSN</literal>) up to which the logical
       slot's consumer has confirmed receiving data. Data corresponding to the
       transactions committed before this <literal>LSN</literal> is not
       available anymore. <literal>NULL</literal> for physical slots.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>wal_status</structfield> <type>text</type>
      </para>
      <para>
       Availability of WAL files claimed by this slot.
       Possible values are:
       <itemizedlist>
        <listitem>
         <para><literal>reserved</literal> means that the claimed files
          are within <varname>max_wal_size</varname>.</para>
        </listitem>
        <listitem>
         <para><literal>extended</literal> means
          that <varname>max_wal_size</varname> is exceeded but the files are
          still retained, either by the replication slot or
          by <varname>wal_keep_size</varname>.
         </para>
        </listitem>
        <listitem>
         <para>
          <literal>unreserved</literal> means that the slot no longer
          retains the required WAL files and some of them are to be removed at
          the next checkpoint.  This state can return
          to <literal>reserved</literal> or <literal>extended</literal>.
         </para>
        </listitem>
        <listitem>
         <para>
          <literal>lost</literal> means that some required WAL files have
          been removed and this slot is no longer usable.
         </para>
        </listitem>
       </itemizedlist>
       The last two states are seen only when
       <xref linkend="guc-max-slot-wal-keep-size"/> is
       non-negative. If <structfield>restart_lsn</structfield> is NULL, this
       field is null.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>safe_wal_size</structfield> <type>int8</type>
      </para>
      <para>
       The number of bytes that can be written to WAL such that this slot
       is not in danger of getting in state "lost".  It is NULL for lost
       slots, as well as if <varname>max_slot_wal_keep_size</varname>
       is <literal>-1</literal>.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>two_phase</structfield> <type>bool</type>
      </para>
      <para>
       True if the slot is enabled for decoding prepared transactions.  Always
       false for physical slots.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>conflicting</structfield> <type>bool</type>
      </para>
      <para>
       True if this logical slot conflicted with recovery (and so is now
       invalidated). Always NULL for physical slots.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="view-pg-roles">
  <title><structname>pg_roles</structname></title>

  <indexterm zone="view-pg-roles">
   <primary>pg_roles</primary>
  </indexterm>

  <para>
   The view <structname>pg_roles</structname> provides access to
   information about database roles.  This is simply a publicly
   readable view of
   <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
   that blanks out the password field.
  </para>

  <table>
   <title><structname>pg_roles</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolname</structfield> <type>name</type>
      </para>
      <para>
       Role name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolsuper</structfield> <type>bool</type>
      </para>
      <para>
       Role has superuser privileges
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolinherit</structfield> <type>bool</type>
      </para>
      <para>
       Role automatically inherits privileges of roles it is a
       member of
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolcreaterole</structfield> <type>bool</type>
      </para>
      <para>
       Role can create more roles
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolcreatedb</structfield> <type>bool</type>
      </para>
      <para>
       Role can create databases
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolcanlogin</structfield> <type>bool</type>
      </para>
      <para>
       Role can log in. That is, this role can be given as the initial
       session authorization identifier
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolreplication</structfield> <type>bool</type>
      </para>
      <para>
       Role is a replication role. A replication role can initiate replication
       connections and create and drop replication slots.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolconnlimit</structfield> <type>int4</type>
      </para>
      <para>
       For roles that can log in, this sets maximum number of concurrent
       connections this role can make.  -1 means no limit.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolpassword</structfield> <type>text</type>
      </para>
      <para>
       Not the password (always reads as <literal>********</literal>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolvaliduntil</structfield> <type>timestamptz</type>
      </para>
      <para>
       Password expiry time (only used for password authentication);
       null if no expiration
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolbypassrls</structfield> <type>bool</type>
      </para>
      <para>
       Role bypasses every row-level security policy, see
       <xref linkend="ddl-rowsecurity"/> for more information.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rolconfig</structfield> <type>text[]</type>
      </para>
      <para>
       Role-specific defaults for run-time configuration variables
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>oid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       ID of role
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-rules">
  <title><structname>pg_rules</structname></title>

  <indexterm zone="view-pg-rules">
   <primary>pg_rules</primary>
  </indexterm>

  <para>
   The view <structname>pg_rules</structname> provides access to
   useful information about query rewrite rules.
  </para>

  <table>
   <title><structname>pg_rules</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table the rule is for
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rulename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link>.<structfield>rulename</structfield>)
      </para>
      <para>
       Name of rule
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>definition</structfield> <type>text</type>
      </para>
      <para>
       Rule definition (a reconstructed creation command)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_rules</structname> view excludes the <literal>ON SELECT</literal> rules
   of views and materialized views; those can be seen in
   <link linkend="view-pg-views"><structname>pg_views</structname></link> and <link linkend="view-pg-matviews"><structname>pg_matviews</structname></link>.
  </para>

 </sect1>

 <sect1 id="view-pg-seclabels">
  <title><structname>pg_seclabels</structname></title>

  <indexterm zone="view-pg-seclabels">
   <primary>pg_seclabels</primary>
  </indexterm>

  <para>
   The view <structname>pg_seclabels</structname> provides information about
   security labels.  It as an easier-to-query version of the
   <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link> catalog.
  </para>

  <table>
   <title><structname>pg_seclabels</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objoid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       The OID of the object this security label pertains to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classoid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the system catalog this object appears in
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objsubid</structfield> <type>int4</type>
      </para>
      <para>
       For a security label on a table column, this is the column number (the
       <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to
       the table itself).  For all other object types, this column is
       zero.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objtype</structfield> <type>text</type>
      </para>
      <para>
       The type of object to which this label applies, as text.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objnamespace</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the namespace for this object, if applicable;
       otherwise NULL.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objname</structfield> <type>text</type>
      </para>
      <para>
       The name of the object to which this label applies, as text.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>provider</structfield> <type>text</type>
       (references <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.<structfield>provider</structfield>)
      </para>
      <para>
       The label provider associated with this label.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>label</structfield> <type>text</type>
       (references <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.<structfield>label</structfield>)
      </para>
      <para>
       The security label applied to this object.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="view-pg-sequences">
  <title><structname>pg_sequences</structname></title>

  <indexterm zone="view-pg-sequences">
   <primary>pg_sequences</primary>
  </indexterm>

  <para>
   The view <structname>pg_sequences</structname> provides access to
   useful information about each sequence in the database.
  </para>

  <table>
   <title><structname>pg_sequences</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sequencename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sequenceowner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of sequence's owner
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>data_type</structfield> <type>regtype</type>
       (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       Data type of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>start_value</structfield> <type>int8</type>
      </para>
      <para>
       Start value of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>min_value</structfield> <type>int8</type>
      </para>
      <para>
       Minimum value of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>max_value</structfield> <type>int8</type>
      </para>
      <para>
       Maximum value of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>increment_by</structfield> <type>int8</type>
      </para>
      <para>
       Increment value of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>cycle</structfield> <type>bool</type>
      </para>
      <para>
       Whether the sequence cycles
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>cache_size</structfield> <type>int8</type>
      </para>
      <para>
       Cache size of the sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>last_value</structfield> <type>int8</type>
      </para>
      <para>
       The last sequence value written to disk.  If caching is used,
       this value can be greater than the last value handed out from the
       sequence.  Null if the sequence has not been read from yet.  Also, if
       the current user does not have <literal>USAGE</literal>
       or <literal>SELECT</literal> privilege on the sequence, the value is
       null.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="view-pg-settings">
  <title><structname>pg_settings</structname></title>

  <indexterm zone="view-pg-settings">
   <primary>pg_settings</primary>
  </indexterm>

  <para>
   The view <structname>pg_settings</structname> provides access to
   run-time parameters of the server.  It is essentially an alternative
   interface to the <link linkend="sql-show"><command>SHOW</command></link>
   and <link linkend="sql-set"><command>SET</command></link> commands.
   It also provides access to some facts about each parameter that are
   not directly available from <link linkend="sql-show"><command>SHOW</command></link>, such as minimum and
   maximum values.
  </para>

  <table>
   <title><structname>pg_settings</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       Run-time configuration parameter name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>setting</structfield> <type>text</type>
      </para>
      <para>
       Current value of the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>unit</structfield> <type>text</type>
      </para>
      <para>
       Implicit unit of the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>category</structfield> <type>text</type>
      </para>
      <para>
       Logical group of the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>short_desc</structfield> <type>text</type>
      </para>
      <para>
       A brief description of the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>extra_desc</structfield> <type>text</type>
      </para>
      <para>
       Additional, more detailed, description of the parameter
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>context</structfield> <type>text</type>
      </para>
      <para>
       Context required to set the parameter's value (see below)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>vartype</structfield> <type>text</type>
      </para>
      <para>
       Parameter type (<literal>bool</literal>, <literal>enum</literal>,
       <literal>integer</literal>, <literal>real</literal>, or <literal>string</literal>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>source</structfield> <type>text</type>
      </para>
      <para>
       Source of the current parameter value
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>min_val</structfield> <type>text</type>
      </para>
      <para>
       Minimum allowed value of the parameter (null for non-numeric
       values)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>max_val</structfield> <type>text</type>
      </para>
      <para>
       Maximum allowed value of the parameter (null for non-numeric
       values)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>enumvals</structfield> <type>text[]</type>
      </para>
      <para>
       Allowed values of an enum parameter (null for non-enum
       values)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>boot_val</structfield> <type>text</type>
      </para>
      <para>
       Parameter value assumed at server startup if the parameter is
       not otherwise set
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>reset_val</structfield> <type>text</type>
      </para>
      <para>
       Value that <link linkend="sql-reset"><command>RESET</command></link> would reset the parameter to
       in the current session
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sourcefile</structfield> <type>text</type>
      </para>
      <para>
       Configuration file the current value was set in (null for
       values set from sources other than configuration files, or when
       examined by a user who neither is a superuser nor has privileges of
       <literal>pg_read_all_settings</literal>); helpful when using
       <literal>include</literal> directives in configuration files
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>sourceline</structfield> <type>int4</type>
      </para>
      <para>
       Line number within the configuration file the current value was
       set at (null for values set from sources other than configuration files,
       or when examined by a user who neither is a superuser nor has privileges of
       <literal>pg_read_all_settings</literal>).
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pending_restart</structfield> <type>bool</type>
      </para>
      <para>
       <literal>true</literal> if the value has been changed in the
       configuration file but needs a restart; or <literal>false</literal>
       otherwise.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   There are several possible values of <structfield>context</structfield>.
   In order of decreasing difficulty of changing the setting, they are:
  </para>

  <variablelist>
   <varlistentry>
    <!-- PGC_INTERNAL -->
    <term><literal>internal</literal></term>
    <listitem>
     <para>
      These settings cannot be changed directly; they reflect internally
      determined values.  Some of them may be adjustable by rebuilding the
      server with different configuration options, or by changing options
      supplied to <application>initdb</application>.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_POSTMASTER -->
    <term><literal>postmaster</literal></term>
    <listitem>
     <para>
      These settings can only be applied when the server starts, so any change
      requires restarting the server.  Values for these settings are typically
      stored in the <filename>postgresql.conf</filename> file, or passed on
      the command line when starting the server.  Of course, settings with any
      of the lower <structfield>context</structfield> types can also be
      set at server start time.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_SIGHUP -->
    <term><literal>sighup</literal></term>
    <listitem>
     <para>
      Changes to these settings can be made in
      <filename>postgresql.conf</filename> without restarting the server.
      Send a <systemitem>SIGHUP</systemitem> signal to the postmaster to
      cause it to re-read <filename>postgresql.conf</filename> and apply
      the changes.  The postmaster will also forward the
      <systemitem>SIGHUP</systemitem> signal to its child processes so that
      they all pick up the new value.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_SU_BACKEND -->
    <term><literal>superuser-backend</literal></term>
    <listitem>
     <para>
      Changes to these settings can be made in
      <filename>postgresql.conf</filename> without restarting the server.
      They can also be set for a particular session in the connection request
      packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal>
      environment variable), but only if the connecting user is a superuser
      or has been granted the appropriate <literal>SET</literal> privilege.
      However, these settings never change in a session after it is started.
      If you change them in <filename>postgresql.conf</filename>, send a
      <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
      re-read <filename>postgresql.conf</filename>.  The new values will only
      affect subsequently-launched sessions.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_BACKEND -->
    <term><literal>backend</literal></term>
    <listitem>
     <para>
      Changes to these settings can be made in
      <filename>postgresql.conf</filename> without restarting the server.
      They can also be set for a particular session in the connection request
      packet (for example, via <application>libpq</application>'s <literal>PGOPTIONS</literal>
      environment variable); any user can make such a change for their session.
      However, these settings never change in a session after it is started.
      If you change them in <filename>postgresql.conf</filename>, send a
      <systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
      re-read <filename>postgresql.conf</filename>.  The new values will only
      affect subsequently-launched sessions.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_SUSET -->
    <term><literal>superuser</literal></term>
    <listitem>
     <para>
      These settings can be set from <filename>postgresql.conf</filename>,
      or within a session via the <command>SET</command> command; but only superusers
      and users with the appropriate <literal>SET</literal> privilege
      can change them via <command>SET</command>.  Changes in
      <filename>postgresql.conf</filename> will affect existing sessions
      only if no session-local value has been established with <command>SET</command>.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_USERSET -->
    <term><literal>user</literal></term>
    <listitem>
     <para>
      These settings can be set from <filename>postgresql.conf</filename>,
      or within a session via the <command>SET</command> command.  Any user is
      allowed to change their session-local value.  Changes in
      <filename>postgresql.conf</filename> will affect existing sessions
      only if no session-local value has been established with <command>SET</command>.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>

  <para>
   See <xref linkend="config-setting"/> for more information about the various
   ways to change these parameters.
  </para>

  <para>
   This view cannot be inserted into or deleted from, but it can be updated.  An
   <command>UPDATE</command> applied to a row of <structname>pg_settings</structname>
   is equivalent to executing the <command>SET</command> command on that named
   parameter. The change only affects the value used by the current
   session. If an <command>UPDATE</command> is issued within a transaction
   that is later aborted, the effects of the <command>UPDATE</command> command
   disappear when the transaction is rolled back. Once the surrounding
   transaction is committed, the effects will persist until the end of the
   session, unless overridden by another <command>UPDATE</command> or
   <command>SET</command>.
  </para>

  <para>
   This view does not
   display <link linkend="runtime-config-custom">customized options</link>
   unless the extension module that defines them has been loaded by the
   backend process executing the query (e.g., via a mention in
   <xref linkend="guc-shared-preload-libraries"/>,
   a call to a C function in the extension, or the
   <link linkend="sql-load"><command>LOAD</command></link> command).
   For example, since <link linkend="archive-modules">archive modules</link>
   are normally loaded only by the archiver process not regular sessions,
   this view will not display any customized options defined by such modules
   unless special action is taken to load them into the backend process
   executing the query.
  </para>

 </sect1>

 <sect1 id="view-pg-shadow">
  <title><structname>pg_shadow</structname></title>

  <indexterm zone="view-pg-shadow">
   <primary>pg_shadow</primary>
  </indexterm>

  <para>
   The view <structname>pg_shadow</structname> exists for backwards
   compatibility: it emulates a catalog that existed in
   <productname>PostgreSQL</productname> before version 8.1.
   It shows properties of all roles that are marked as
   <structfield>rolcanlogin</structfield> in
   <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.
  </para>

  <para>
   The name stems from the fact that this table
   should not be readable by the public since it contains passwords.
   <link linkend="view-pg-user"><structname>pg_user</structname></link>
   is a publicly readable view on
   <structname>pg_shadow</structname> that blanks out the password field.
  </para>

  <table>
   <title><structname>pg_shadow</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       User name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesysid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       ID of this user
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usecreatedb</structfield> <type>bool</type>
      </para>
      <para>
       User can create databases
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesuper</structfield> <type>bool</type>
      </para>
      <para>
       User is a superuser
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>userepl</structfield> <type>bool</type>
      </para>
      <para>
       User can initiate streaming replication and put the system in and
       out of backup mode.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usebypassrls</structfield> <type>bool</type>
      </para>
      <para>
       User bypasses every row-level security policy, see
       <xref linkend="ddl-rowsecurity"/> for more information.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>passwd</structfield> <type>text</type>
      </para>
      <para>
       Password (possibly encrypted); null if none.  See
       <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
       for details of how encrypted passwords are stored.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>valuntil</structfield> <type>timestamptz</type>
      </para>
      <para>
       Password expiry time (only used for password authentication)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>useconfig</structfield> <type>text[]</type>
      </para>
      <para>
       Session defaults for run-time configuration variables
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-shmem-allocations">
  <title><structname>pg_shmem_allocations</structname></title>

  <indexterm zone="view-pg-shmem-allocations">
   <primary>pg_shmem_allocations</primary>
  </indexterm>

  <para>
   The <structname>pg_shmem_allocations</structname> view shows allocations
   made from the server's main shared memory segment.  This includes both
   memory allocated by <productname>PostgreSQL</productname> itself and memory
   allocated by extensions using the mechanisms detailed in
   <xref linkend="xfunc-shared-addin" />.
  </para>

  <para>
   Note that this view does not include memory allocated using the dynamic
   shared memory infrastructure.
  </para>

  <table>
   <title><structname>pg_shmem_allocations</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       The name of the shared memory allocation. NULL for unused memory
       and <literal>&lt;anonymous&gt;</literal> for anonymous
       allocations.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>off</structfield> <type>int8</type>
      </para>
      <para>
       The offset at which the allocation starts. NULL for anonymous
       allocations, since details related to them are not known.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>size</structfield> <type>int8</type>
      </para>
      <para>
       Size of the allocation in bytes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>allocated_size</structfield> <type>int8</type>
      </para>
      <para>
       Size of the allocation in bytes including padding. For anonymous
       allocations, no information about padding is available, so the
       <literal>size</literal> and <literal>allocated_size</literal> columns
       will always be equal. Padding is not meaningful for free memory, so
       the columns will be equal in that case also.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Anonymous allocations are allocations that have been made
   with <literal>ShmemAlloc()</literal> directly, rather than via
   <literal>ShmemInitStruct()</literal> or
   <literal>ShmemInitHash()</literal>.
  </para>

  <para>
   By default, the <structname>pg_shmem_allocations</structname> view can be
   read only by superusers or roles with privileges of the
   <literal>pg_read_all_stats</literal> role.
  </para>
 </sect1>

 <sect1 id="view-pg-stats">
  <title><structname>pg_stats</structname></title>

  <indexterm zone="view-pg-stats">
   <primary>pg_stats</primary>
  </indexterm>

  <para>
   The view <structname>pg_stats</structname> provides access to
   the information stored in the <link
   linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>
   catalog.  This view allows access only to rows of
   <link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link> that correspond to tables the
   user has permission to read, and therefore it is safe to allow public
   read access to this view.
  </para>

  <para>
   <structname>pg_stats</structname> is also designed to present the
   information in a more readable format than the underlying catalog
   &mdash; at the cost that its schema must be extended whenever new slot types
   are defined for <link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>.
  </para>

  <table>
   <title><structname>pg_stats</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>attname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attname</structfield>)
      </para>
      <para>
       Name of column described by this row
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>inherited</structfield> <type>bool</type>
      </para>
      <para>
       If true, this row includes values from child tables, not just the
       values in the specified table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>null_frac</structfield> <type>float4</type>
      </para>
      <para>
       Fraction of column entries that are null
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>avg_width</structfield> <type>int4</type>
      </para>
      <para>
       Average width in bytes of column's entries
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>n_distinct</structfield> <type>float4</type>
      </para>
      <para>
       If greater than zero, the estimated number of distinct values in the
       column.  If less than zero, the negative of the number of distinct
       values divided by the number of rows.  (The negated form is used when
       <command>ANALYZE</command> believes that the number of distinct values is
       likely to increase as the table grows; the positive form is used when
       the column seems to have a fixed number of possible values.)  For
       example, -1 indicates a unique column in which the number of distinct
       values is the same as the number of rows.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_vals</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of the most common values in the column. (Null if
       no values seem to be more common than any others.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_freqs</structfield> <type>float4[]</type>
      </para>
      <para>
       A list of the frequencies of the most common values,
       i.e., number of occurrences of each divided by total number of rows.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>histogram_bounds</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of values that divide the column's values into groups of
       approximately equal population.  The values in
       <structfield>most_common_vals</structfield>, if present, are omitted from this
       histogram calculation.  (This column is null if the column data type
       does not have a <literal>&lt;</literal> operator or if the
       <structfield>most_common_vals</structfield> list accounts for the entire
       population.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>correlation</structfield> <type>float4</type>
      </para>
      <para>
       Statistical correlation between physical row ordering and
       logical ordering of the column values.  This ranges from -1 to +1.
       When the value is near -1 or +1, an index scan on the column will
       be estimated to be cheaper than when it is near zero, due to reduction
       of random access to the disk.  (This column is null if the column data
       type does not have a <literal>&lt;</literal> operator.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_elems</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of non-null element values most often appearing within values of
       the column. (Null for scalar types.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_elem_freqs</structfield> <type>float4[]</type>
      </para>
      <para>
       A list of the frequencies of the most common element values, i.e., the
       fraction of rows containing at least one instance of the given value.
       Two or three additional values follow the per-element frequencies;
       these are the minimum and maximum of the preceding per-element
       frequencies, and optionally the frequency of null elements.
       (Null when <structfield>most_common_elems</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>elem_count_histogram</structfield> <type>float4[]</type>
      </para>
      <para>
       A histogram of the counts of distinct non-null element values within the
       values of the column, followed by the average number of distinct
       non-null elements.  (Null for scalar types.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the array fields can be controlled on a
   column-by-column basis using the <link linkend="sql-altertable"><command>ALTER
   TABLE SET STATISTICS</command></link>
   command, or globally by setting the
   <xref linkend="guc-default-statistics-target"/> run-time parameter.
  </para>

 </sect1>

 <sect1 id="view-pg-stats-ext">
  <title><structname>pg_stats_ext</structname></title>

  <indexterm zone="view-pg-stats-ext">
   <primary>pg_stats_ext</primary>
  </indexterm>

  <para>
   The view <structname>pg_stats_ext</structname> provides access to
   information about each extended statistics object in the database,
   combining information stored in the <link
   linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>
   and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
   catalogs.  This view allows access only to rows of
   <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link> and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
   that correspond to tables the user owns, and therefore
   it is safe to allow public read access to this view.
  </para>

  <para>
   <structname>pg_stats_ext</structname> is also designed to present the
   information in a more readable format than the underlying catalogs
   &mdash; at the cost that its schema must be extended whenever new types
   of extended statistics are added to <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.
  </para>

  <table>
   <title><structname>pg_stats_ext</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_name</structfield> <type>name</type>
       (references <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.<structfield>stxname</structfield>)
      </para>
      <para>
       Name of extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_owner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Owner of the extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>attnames</structfield> <type>name[]</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attname</structfield>)
      </para>
      <para>
       Names of the columns included in the extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>exprs</structfield> <type>text[]</type>
      </para>
      <para>
       Expressions included in the extended statistics object
      </para></entry>
      </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>kinds</structfield> <type>char[]</type>
      </para>
      <para>
       Types of extended statistics object enabled for this record
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>inherited</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>)
      </para>
      <para>
       If true, the stats include values from child tables, not just the
       values in the specified relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>n_distinct</structfield> <type>pg_ndistinct</type>
      </para>
      <para>
       N-distinct counts for combinations of column values. If greater
       than zero, the estimated number of distinct values in the combination.
       If less than zero, the negative of the number of distinct values divided
       by the number of rows.
       (The negated form is used when <command>ANALYZE</command> believes that
       the number of distinct values is likely to increase as the table grows;
       the positive form is used when the column seems to have a fixed number
       of possible values.)  For example, -1 indicates a unique combination of
       columns in which the number of distinct combinations is the same as the
       number of rows.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>dependencies</structfield> <type>pg_dependencies</type>
      </para>
      <para>
       Functional dependency statistics
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_vals</structfield> <type>text[]</type>
      </para>
      <para>
       A list of the most common combinations of values in the columns.
       (Null if no combinations seem to be more common than any others.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_val_nulls</structfield> <type>bool[]</type>
      </para>
      <para>
       A list of NULL flags for the most common combinations of values.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_freqs</structfield> <type>float8[]</type>
      </para>
      <para>
       A list of the frequencies of the most common combinations,
       i.e., number of occurrences of each divided by total number of rows.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_base_freqs</structfield> <type>float8[]</type>
      </para>
      <para>
       A list of the base frequencies of the most common combinations,
       i.e., product of per-value frequencies.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the array fields can be controlled on a
   column-by-column basis using the <link linkend="sql-altertable"><command>ALTER
   TABLE SET STATISTICS</command></link> command, or globally by setting the
   <xref linkend="guc-default-statistics-target"/> run-time parameter.
  </para>

 </sect1>

 <sect1 id="view-pg-stats-ext-exprs">
  <title><structname>pg_stats_ext_exprs</structname></title>

  <indexterm zone="view-pg-stats-ext-exprs">
   <primary>pg_stats_ext_exprs</primary>
  </indexterm>

  <para>
   The view <structname>pg_stats_ext_exprs</structname> provides access to
   information about all expressions included in extended statistics objects,
   combining information stored in the <link
   linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>
   and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
   catalogs.  This view allows access only to rows of
   <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link> and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
   that correspond to tables the user owns, and therefore
   it is safe to allow public read access to this view.
  </para>

  <para>
   <structname>pg_stats_ext_exprs</structname> is also designed to present
   the information in a more readable format than the underlying catalogs
   &mdash; at the cost that its schema must be extended whenever the structure
   of statistics in <structname>pg_statistic_ext</structname> changes.
  </para>

  <table>
   <title><structname>pg_stats_ext_exprs</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table the statistics object is defined on
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_name</structfield> <type>name</type>
       (references <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.<structfield>stxname</structfield>)
      </para>
      <para>
       Name of extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>statistics_owner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Owner of the extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>expr</structfield> <type>text</type>
      </para>
      <para>
       Expression included in the extended statistics object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>inherited</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>)
      </para>
      <para>
       If true, the stats include values from child tables, not just the
       values in the specified relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>null_frac</structfield> <type>float4</type>
      </para>
      <para>
       Fraction of expression entries that are null
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>avg_width</structfield> <type>int4</type>
      </para>
      <para>
       Average width in bytes of expression's entries
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>n_distinct</structfield> <type>float4</type>
      </para>
      <para>
       If greater than zero, the estimated number of distinct values in the
       expression.  If less than zero, the negative of the number of distinct
       values divided by the number of rows.  (The negated form is used when
       <command>ANALYZE</command> believes that the number of distinct values is
       likely to increase as the table grows; the positive form is used when
       the expression seems to have a fixed number of possible values.)  For
       example, -1 indicates a unique expression in which the number of distinct
       values is the same as the number of rows.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_vals</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of the most common values in the expression. (Null if
       no values seem to be more common than any others.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_freqs</structfield> <type>float4[]</type>
      </para>
      <para>
       A list of the frequencies of the most common values,
       i.e., number of occurrences of each divided by total number of rows.
       (Null when <structfield>most_common_vals</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>histogram_bounds</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of values that divide the expression's values into groups of
       approximately equal population.  The values in
       <structfield>most_common_vals</structfield>, if present, are omitted from this
       histogram calculation.  (This expression is null if the expression data type
       does not have a <literal>&lt;</literal> operator or if the
       <structfield>most_common_vals</structfield> list accounts for the entire
       population.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>correlation</structfield> <type>float4</type>
      </para>
      <para>
       Statistical correlation between physical row ordering and
       logical ordering of the expression values.  This ranges from -1 to +1.
       When the value is near -1 or +1, an index scan on the expression will
       be estimated to be cheaper than when it is near zero, due to reduction
       of random access to the disk.  (This expression is null if the expression's
       data type does not have a <literal>&lt;</literal> operator.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_elems</structfield> <type>anyarray</type>
      </para>
      <para>
       A list of non-null element values most often appearing within values of
       the expression. (Null for scalar types.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>most_common_elem_freqs</structfield> <type>float4[]</type>
      </para>
      <para>
       A list of the frequencies of the most common element values, i.e., the
       fraction of rows containing at least one instance of the given value.
       Two or three additional values follow the per-element frequencies;
       these are the minimum and maximum of the preceding per-element
       frequencies, and optionally the frequency of null elements.
       (Null when <structfield>most_common_elems</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>elem_count_histogram</structfield> <type>float4[]</type>
      </para>
      <para>
       A histogram of the counts of distinct non-null element values within the
       values of the expression, followed by the average number of distinct
       non-null elements.  (Null for scalar types.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the array fields can be controlled on a
   column-by-column basis using the <link linkend="sql-altertable"><command>ALTER
   TABLE SET STATISTICS</command></link> command, or globally by setting the
   <xref linkend="guc-default-statistics-target"/> run-time parameter.
  </para>

 </sect1>

 <sect1 id="view-pg-tables">
  <title><structname>pg_tables</structname></title>

  <indexterm zone="view-pg-tables">
   <primary>pg_tables</primary>
  </indexterm>

  <para>
   The view <structname>pg_tables</structname> provides access to
   useful information about each table in the database.
  </para>

  <table>
   <title><structname>pg_tables</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tableowner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of table's owner
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablespace</structfield> <type>name</type>
       (references <link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.<structfield>spcname</structfield>)
      </para>
      <para>
       Name of tablespace containing table (null if default for database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hasindexes</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relhasindex</structfield>)
      </para>
      <para>
       True if table has (or recently had) any indexes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hasrules</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relhasrules</structfield>)
      </para>
      <para>
       True if table has (or once had) rules
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hastriggers</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relhastriggers</structfield>)
      </para>
      <para>
       True if table has (or once had) triggers
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rowsecurity</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relrowsecurity</structfield>)
      </para>
      <para>
       True if row security is enabled on the table
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-timezone-abbrevs">
  <title><structname>pg_timezone_abbrevs</structname></title>

  <indexterm zone="view-pg-timezone-abbrevs">
   <primary>pg_timezone_abbrevs</primary>
  </indexterm>

  <para>
   The view <structname>pg_timezone_abbrevs</structname> provides a list
   of time zone abbreviations that are currently recognized by the datetime
   input routines.  The contents of this view change when the
   <xref linkend="guc-timezone-abbreviations"/> run-time parameter is modified.
  </para>

  <table>
   <title><structname>pg_timezone_abbrevs</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>abbrev</structfield> <type>text</type>
      </para>
      <para>
       Time zone abbreviation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>utc_offset</structfield> <type>interval</type>
      </para>
      <para>
       Offset from UTC (positive means east of Greenwich)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_dst</structfield> <type>bool</type>
      </para>
      <para>
       True if this is a daylight-savings abbreviation
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   While most timezone abbreviations represent fixed offsets from UTC,
   there are some that have historically varied in value
   (see <xref linkend="datetime-config-files"/> for more information).
   In such cases this view presents their current meaning.
  </para>

 </sect1>

 <sect1 id="view-pg-timezone-names">
  <title><structname>pg_timezone_names</structname></title>

  <indexterm zone="view-pg-timezone-names">
   <primary>pg_timezone_names</primary>
  </indexterm>

  <para>
   The view <structname>pg_timezone_names</structname> provides a list
   of time zone names that are recognized by <command>SET TIMEZONE</command>,
   along with their associated abbreviations, UTC offsets,
   and daylight-savings status.  (Technically,
   <productname>PostgreSQL</productname> does not use UTC because leap
   seconds are not handled.)
   Unlike the abbreviations shown in <link
   linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link>, many of these names imply a set of daylight-savings transition
   date rules.  Therefore, the associated information changes across local DST
   boundaries.  The displayed information is computed based on the current
   value of <function>CURRENT_TIMESTAMP</function>.
  </para>

  <table>
   <title><structname>pg_timezone_names</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>name</structfield> <type>text</type>
      </para>
      <para>
       Time zone name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>abbrev</structfield> <type>text</type>
      </para>
      <para>
       Time zone abbreviation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>utc_offset</structfield> <type>interval</type>
      </para>
      <para>
       Offset from UTC (positive means east of Greenwich)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_dst</structfield> <type>bool</type>
      </para>
      <para>
       True if currently observing daylight savings
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-user">
  <title><structname>pg_user</structname></title>

  <indexterm zone="view-pg-user">
   <primary>pg_user</primary>
  </indexterm>

  <para>
   The view <structname>pg_user</structname> provides access to
   information about database users.  This is simply a publicly
   readable view of
   <link linkend="view-pg-shadow"><structname>pg_shadow</structname></link>
   that blanks out the password field.
  </para>

  <table>
   <title><structname>pg_user</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usename</structfield> <type>name</type>
      </para>
      <para>
       User name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesysid</structfield> <type>oid</type>
      </para>
      <para>
       ID of this user
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usecreatedb</structfield> <type>bool</type>
      </para>
      <para>
       User can create databases
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesuper</structfield> <type>bool</type>
      </para>
      <para>
       User is a superuser
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>userepl</structfield> <type>bool</type>
      </para>
      <para>
       User can initiate streaming replication and put the system in and
       out of backup mode.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usebypassrls</structfield> <type>bool</type>
      </para>
      <para>
       User bypasses every row-level security policy, see
       <xref linkend="ddl-rowsecurity"/> for more information.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>passwd</structfield> <type>text</type>
      </para>
      <para>
       Not the password (always reads as <literal>********</literal>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>valuntil</structfield> <type>timestamptz</type>
      </para>
      <para>
       Password expiry time (only used for password authentication)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>useconfig</structfield> <type>text[]</type>
      </para>
      <para>
       Session defaults for run-time configuration variables
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-user-mappings">
  <title><structname>pg_user_mappings</structname></title>

  <indexterm zone="view-pg-user-mappings">
   <primary>pg_user_mappings</primary>
  </indexterm>

  <para>
   The view <structname>pg_user_mappings</structname> provides access
   to information about user mappings.  This is essentially a publicly
   readable view of
   <link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>
   that leaves out the options field if the user has no rights to use
   it.
  </para>

  <table>
   <title><structname>pg_user_mappings</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>umid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the user mapping
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srvid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the foreign server that contains this mapping
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srvname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.<structfield>srvname</structfield>)
      </para>
      <para>
       Name of the foreign server
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>umuser</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the local role being mapped, or zero if the user mapping is public
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usename</structfield> <type>name</type>
      </para>
      <para>
       Name of the local user to be mapped
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>umoptions</structfield> <type>text[]</type>
      </para>
      <para>
       User mapping specific options, as <quote>keyword=value</quote> strings
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   To protect password information stored as a user mapping option,
   the <structfield>umoptions</structfield> column will read as null
   unless one of the following applies:
   <itemizedlist>
    <listitem>
     <para>
      current user is the user being mapped, and owns the server or
      holds <literal>USAGE</literal> privilege on it
     </para>
    </listitem>
    <listitem>
     <para>
      current user is the server owner and mapping is for <literal>PUBLIC</literal>
     </para>
    </listitem>
    <listitem>
     <para>
      current user is a superuser
     </para>
    </listitem>
   </itemizedlist>
  </para>

 </sect1>


 <sect1 id="view-pg-views">
  <title><structname>pg_views</structname></title>

  <indexterm zone="view-pg-views">
   <primary>pg_views</primary>
  </indexterm>

  <para>
   The view <structname>pg_views</structname> provides access to
   useful information about each view in the database.
  </para>

  <table>
   <title><structname>pg_views</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>viewname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>viewowner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of view's owner
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>definition</structfield> <type>text</type>
      </para>
      <para>
       View definition (a reconstructed <xref linkend="sql-select"/> query)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

</chapter>