head	2.231;
access;
symbols
	REL9_0_0:2.225.2.4
	REL9_1_ALPHA1:2.228
	REL9_0_RC1:2.225.2.2
	REL9_0_BETA4:2.225
	REL9_0_STABLE:2.225.0.2
	REL9_0_BETA3:2.225
	REL9_0_BETA2:2.225
	REL7_4_29:2.78
	REL8_0_25:2.95
	REL8_1_21:2.115
	REL8_2_17:2.137.2.1
	REL8_3_11:2.161
	REL8_4_4:2.200.2.2
	REL9_0_BETA1:2.225
	REL9_0_ALPHA5_BRANCH:2.224.0.2
	REL9_0_ALPHA5:2.224
	REL7_4_28:2.78
	REL8_0_24:2.95
	REL8_1_20:2.115
	REL8_2_16:2.137.2.1
	REL8_3_10:2.161
	REL8_4_3:2.200.2.2
	REL9_0_ALPHA4:2.223
	REL9_0_ALPHA4_BRANCH:2.223.0.2
	REL8_5_ALPHA3:2.214
	REL8_5_ALPHA3_BRANCH:2.214.0.2
	REL7_4_27:2.78
	REL8_0_23:2.95
	REL8_1_19:2.115
	REL8_2_15:2.137.2.1
	REL8_3_9:2.161
	REL8_4_2:2.200.2.2
	REL8_5_ALPHA2:2.210
	REL8_5_ALPHA2_BRANCH:2.210.0.2
	REL7_4_26:2.78
	REL8_0_22:2.95
	REL8_1_18:2.115
	REL8_2_14:2.137.2.1
	REL8_3_8:2.161
	REL8_4_1:2.200.2.2
	REL8_5_ALPHA1:2.206
	REL8_5_ALPHA1_BRANCH:2.206.0.2
	REL8_4_STABLE:2.200.0.2
	REL8_4_0:2.200
	REL8_4_RC2:2.200
	REL8_4_RC1:2.200
	REL8_4_BETA2:2.200
	REL8_4_BETA1:2.200
	REL7_4_25:2.78
	REL8_0_21:2.95
	REL8_1_17:2.115
	REL8_2_13:2.137.2.1
	REL8_3_7:2.161
	REL7_4_24:2.78
	REL8_0_20:2.95
	REL8_1_16:2.115
	REL8_2_12:2.137.2.1
	REL8_3_6:2.161
	REL7_4_23:2.78
	REL8_0_19:2.95
	REL8_1_15:2.115
	REL8_2_11:2.137.2.1
	REL8_3_5:2.161
	REL7_4_22:2.78
	REL8_0_18:2.95
	REL8_1_14:2.115
	REL8_2_10:2.137.2.1
	REL8_3_4:2.161
	REL7_4_21:2.78
	REL8_0_17:2.95
	REL8_1_13:2.115
	REL8_2_9:2.137.2.1
	REL8_3_3:2.161
	REL7_4_20:2.78
	REL8_0_16:2.95
	REL8_1_12:2.115
	REL8_2_8:2.137.2.1
	REL8_3_2:2.161
	REL8_2_7:2.137.2.1
	REL8_3_1:2.161
	REL8_3_STABLE:2.161.0.2
	REL8_3_0:2.161
	REL8_3_RC2:2.159
	REL7_3_21:2.63
	REL7_4_19:2.78
	REL8_0_15:2.95
	REL8_1_11:2.115
	REL8_2_6:2.137
	REL8_3_RC1:2.159
	REL8_3_BETA4:2.159
	REL8_3_BETA3:2.159
	REL8_3_BETA2:2.159
	REL8_3_BETA1:2.159
	REL7_3_20:2.63
	REL7_4_18:2.78
	REL8_0_14:2.95
	REL8_1_10:2.115
	REL8_2_5:2.137
	REL7_3_19:2.63
	REL7_4_17:2.78
	REL8_0_13:2.95
	REL8_1_9:2.115
	REL8_2_4:2.137
	REL8_0_12:2.95
	REL8_1_8:2.115
	REL8_2_3:2.137
	REL7_3_18:2.63
	REL7_4_16:2.78
	REL8_0_11:2.95
	REL8_1_7:2.115
	REL8_2_2:2.137
	REL8_0_10:2.95
	REL8_1_6:2.115
	REL8_2_1:2.137
	REL7_4_15:2.78
	REL7_3_17:2.63
	REL8_2_STABLE:2.137.0.2
	REL8_2_0:2.137
	REL8_2_RC1:2.137
	REL8_2_BETA3:2.136
	REL8_2_BETA2:2.135
	REL8_1_5:2.115
	REL8_0_9:2.95
	REL7_4_14:2.78
	REL7_3_16:2.63
	REL8_2_BETA1:2.134
	REL7_3_15:2.63
	REL7_4_13:2.78
	REL8_0_8:2.95
	REL8_1_4:2.115
	REL7_3_14:2.63
	REL7_4_12:2.78
	REL8_0_7:2.95
	REL8_1_3:2.115
	REL7_3_13:2.63
	REL7_4_11:2.78
	REL8_0_6:2.95
	REL8_1_2:2.115
	REL7_3_12:2.63
	REL7_4_10:2.78
	REL8_0_5:2.95
	REL8_1_1:2.115
	REL8_1_STABLE:2.115.0.2
	REL8_1_0:2.115
	REL8_1_0RC1:2.114
	REL8_1_0BETA4:2.114
	REL8_1_0BETA3:2.114
	REL7_3_11:2.63
	REL7_4_9:2.78
	REL8_0_4:2.95
	REL8_1_0BETA2:2.114
	REL8_1_0BETA1:2.112
	REL7_2_8:2.29
	REL7_3_10:2.63
	REL7_4_8:2.78
	REL8_0_3:2.95
	REL8_0_2:2.95
	REL7_2_7:2.29
	REL7_3_9:2.63
	REL7_4_7:2.78
	REL8_0_1:2.95
	REL8_0_STABLE:2.95.0.4
	REL8_0_0:2.95.0.2
	REL8_0_0RC5:2.95
	REL8_0_0RC4:2.95
	REL8_0_0RC3:2.94
	REL8_0_0RC2:2.94
	REL8_0_0RC1:2.93
	REL8_0_0BETA5:2.92
	REL8_0_0BETA4:2.90
	REL7_4_6:2.78
	REL7_3_8:2.63
	REL7_2_6:2.29
	REL8_0_0BETA3:2.89
	REL8_0_0BETA2:2.89
	REL7_2_5:2.29
	REL7_4_5:2.78
	REL7_3_7:2.63
	REL7_4_4:2.78
	REL8_0_0BETA1:2.89
	REL7_4_3:2.78
	REL7_4_2:2.78
	REL7_3_6:2.63
	REL7_4_1:2.78
	REL7_3_5:2.63
	REL7_4:2.78
	REL7_4_RC2:2.78
	REL7_4_STABLE:2.78.0.2
	REL7_4_RC1:2.78
	REL7_4_BETA5:2.76
	REL7_4_BETA4:2.74
	REL7_4_BETA3:2.74
	REL7_4_BETA2:2.73
	WIN32_DEV:2.73.0.2
	REL7_4_BETA1:2.73
	REL7_3_4:2.63
	REL7_3_2:2.63
	REL7_2_4:2.29
	REL7_3_STABLE:2.63.0.2
	REL7_2_3:2.29
	REL7_2_STABLE:2.29.0.2
	REL7_2:2.29
	REL7_2_RC2:2.29
	REL7_2_RC1:2.29
	REL7_2_BETA5:2.29
	REL7_2_BETA4:2.29
	REL7_2_BETA3:2.28
	REL7_2_BETA2:2.27
	REL7_2_BETA1:2.26
	REL7_1_2:2.15
	REL7_1_STABLE:2.15.0.2
	REL7_1_BETA:2.8
	REL7_1_BETA3:2.13
	REL7_1_BETA2:2.13
	REL7_1:2.14
	REL7_0_PATCHES:2.5.0.2
	REL7_0:2.5;
locks; strict;
comment	@# @;


2.231
date	2010.09.17.18.49.54;	author rhaas;	state Exp;
branches;
next	2.230;

2.230
date	2010.09.13.17.02.34;	author rhaas;	state Exp;
branches;
next	2.229;

2.229
date	2010.09.13.01.23.35;	author rhaas;	state Exp;
branches;
next	2.228;

2.228
date	2010.09.03.01.34.54;	author tgl;	state Exp;
branches;
next	2.227;

2.227
date	2010.08.25.18.18.41;	author petere;	state Exp;
branches;
next	2.226;

2.226
date	2010.08.17.04.37.20;	author petere;	state Exp;
branches;
next	2.225;

2.225
date	2010.04.03.07.22.52;	author petere;	state Exp;
branches
	2.225.2.1;
next	2.224;

2.224
date	2010.03.25.14.44.33;	author alvherre;	state Exp;
branches;
next	2.223;

2.223
date	2010.02.17.04.19.37;	author tgl;	state Exp;
branches;
next	2.222;

2.222
date	2010.02.16.22.34.41;	author tgl;	state Exp;
branches;
next	2.221;

2.221
date	2010.02.07.20.48.09;	author tgl;	state Exp;
branches;
next	2.220;

2.220
date	2010.02.03.17.25.05;	author momjian;	state Exp;
branches;
next	2.219;

2.219
date	2010.01.22.16.40.18;	author rhaas;	state Exp;
branches;
next	2.218;

2.218
date	2010.01.17.22.56.21;	author tgl;	state Exp;
branches;
next	2.217;

2.217
date	2010.01.10.01.23.08;	author rhaas;	state Exp;
branches;
next	2.216;

2.216
date	2010.01.01.21.53.48;	author tgl;	state Exp;
branches;
next	2.215;

2.215
date	2009.12.29.20.11.42;	author tgl;	state Exp;
branches;
next	2.214;

2.214
date	2009.12.17.14.36.15;	author rhaas;	state Exp;
branches;
next	2.213;

2.213
date	2009.12.11.03.34.54;	author itagaki;	state Exp;
branches;
next	2.212;

2.212
date	2009.12.07.05.22.21;	author tgl;	state Exp;
branches;
next	2.211;

2.211
date	2009.11.20.20.38.09;	author tgl;	state Exp;
branches;
next	2.210;

2.210
date	2009.10.14.22.14.21;	author tgl;	state Exp;
branches;
next	2.209;

2.209
date	2009.10.07.22.14.14;	author alvherre;	state Exp;
branches;
next	2.208;

2.208
date	2009.10.05.19.24.32;	author tgl;	state Exp;
branches;
next	2.207;

2.207
date	2009.09.22.23.43.37;	author tgl;	state Exp;
branches;
next	2.206;

2.206
date	2009.08.10.22.13.50;	author alvherre;	state Exp;
branches;
next	2.205;

2.205
date	2009.08.04.04.04.11;	author tgl;	state Exp;
branches;
next	2.204;

2.204
date	2009.08.02.22.14.51;	author tgl;	state Exp;
branches;
next	2.203;

2.203
date	2009.07.29.20.56.17;	author tgl;	state Exp;
branches;
next	2.202;

2.202
date	2009.07.28.02.56.29;	author tgl;	state Exp;
branches;
next	2.201;

2.201
date	2009.07.01.23.57.33;	author tgl;	state Exp;
branches;
next	2.200;

2.200
date	2009.03.31.17.59.55;	author tgl;	state Exp;
branches
	2.200.2.1;
next	2.199;

2.199
date	2009.03.05.23.06.45;	author tgl;	state Exp;
branches;
next	2.198;

2.198
date	2009.02.24.10.06.31;	author petere;	state Exp;
branches;
next	2.197;

2.197
date	2009.02.09.20.57.59;	author alvherre;	state Exp;
branches;
next	2.196;

2.196
date	2009.02.07.19.27.25;	author momjian;	state Exp;
branches;
next	2.195;

2.195
date	2009.02.07.15.00.27;	author momjian;	state Exp;
branches;
next	2.194;

2.194
date	2009.02.04.21.30.41;	author alvherre;	state Exp;
branches;
next	2.193;

2.193
date	2009.02.02.09.49.29;	author petere;	state Exp;
branches;
next	2.192;

2.192
date	2009.01.27.12.40.14;	author petere;	state Exp;
branches;
next	2.191;

2.191
date	2009.01.22.20.15.59;	author tgl;	state Exp;
branches;
next	2.190;

2.190
date	2009.01.22.17.27.54;	author petere;	state Exp;
branches;
next	2.189;

2.189
date	2009.01.16.13.27.23;	author heikki;	state Exp;
branches;
next	2.188;

2.188
date	2009.01.09.15.02.22;	author momjian;	state Exp;
branches;
next	2.187;

2.187
date	2009.01.09.01.53.10;	author adunstan;	state Exp;
branches;
next	2.186;

2.186
date	2008.12.19.18.25.19;	author tgl;	state Exp;
branches;
next	2.185;

2.185
date	2008.12.19.16.25.16;	author petere;	state Exp;
branches;
next	2.184;

2.184
date	2008.12.18.18.20.33;	author tgl;	state Exp;
branches;
next	2.183;

2.183
date	2008.11.21.19.31.58;	author mha;	state Exp;
branches;
next	2.182;

2.182
date	2008.11.10.00.49.36;	author tgl;	state Exp;
branches;
next	2.181;

2.181
date	2008.11.09.21.24.32;	author tgl;	state Exp;
branches;
next	2.180;

2.180
date	2008.10.31.08.39.19;	author heikki;	state Exp;
branches;
next	2.179;

2.179
date	2008.10.17.22.10.29;	author tgl;	state Exp;
branches;
next	2.178;

2.178
date	2008.10.06.13.59.37;	author tgl;	state Exp;
branches;
next	2.177;

2.177
date	2008.10.06.13.05.36;	author mha;	state Exp;
branches;
next	2.176;

2.176
date	2008.09.23.09.20.33;	author heikki;	state Exp;
branches;
next	2.175;

2.175
date	2008.09.19.19.03.40;	author tgl;	state Exp;
branches;
next	2.174;

2.174
date	2008.09.15.18.43.41;	author tgl;	state Exp;
branches;
next	2.173;

2.173
date	2008.09.10.18.09.19;	author alvherre;	state Exp;
branches;
next	2.172;

2.172
date	2008.07.30.17.05.04;	author tgl;	state Exp;
branches;
next	2.171;

2.171
date	2008.07.18.03.32.51;	author tgl;	state Exp;
branches;
next	2.170;

2.170
date	2008.07.16.16.55.23;	author tgl;	state Exp;
branches;
next	2.169;

2.169
date	2008.07.16.01.30.21;	author tgl;	state Exp;
branches;
next	2.168;

2.168
date	2008.07.14.00.51.45;	author tgl;	state Exp;
branches;
next	2.167;

2.167
date	2008.07.11.07.02.43;	author petere;	state Exp;
branches;
next	2.166;

2.166
date	2008.05.09.23.32.03;	author tgl;	state Exp;
branches;
next	2.165;

2.165
date	2008.04.14.17.05.32;	author tgl;	state Exp;
branches;
next	2.164;

2.164
date	2008.04.10.22.25.25;	author tgl;	state Exp;
branches;
next	2.163;

2.163
date	2008.03.10.12.55.13;	author mha;	state Exp;
branches;
next	2.162;

2.162
date	2008.03.06.18.49.32;	author momjian;	state Exp;
branches;
next	2.161;

2.161
date	2008.01.31.18.40.02;	author tgl;	state Exp;
branches;
next	2.160;

2.160
date	2008.01.29.13.03.50;	author petere;	state Exp;
branches;
next	2.159;

2.159
date	2007.10.01.21.10.40;	author tgl;	state Exp;
branches;
next	2.158;

2.158
date	2007.09.20.17.56.30;	author tgl;	state Exp;
branches;
next	2.157;

2.157
date	2007.09.05.18.10.47;	author tgl;	state Exp;
branches;
next	2.156;

2.156
date	2007.09.03.00.39.11;	author tgl;	state Exp;
branches;
next	2.155;

2.155
date	2007.06.20.19.24.05;	author neilc;	state Exp;
branches;
next	2.154;

2.154
date	2007.06.08.21.09.49;	author alvherre;	state Exp;
branches;
next	2.153;

2.153
date	2007.06.05.21.31.03;	author tgl;	state Exp;
branches;
next	2.152;

2.152
date	2007.05.15.19.13.54;	author neilc;	state Exp;
branches;
next	2.151;

2.151
date	2007.05.11.17.57.11;	author tgl;	state Exp;
branches;
next	2.150;

2.150
date	2007.04.06.22.33.41;	author tgl;	state Exp;
branches;
next	2.149;

2.149
date	2007.04.02.03.49.36;	author tgl;	state Exp;
branches;
next	2.148;

2.148
date	2007.03.26.16.58.37;	author tgl;	state Exp;
branches;
next	2.147;

2.147
date	2007.03.22.15.46.56;	author momjian;	state Exp;
branches;
next	2.146;

2.146
date	2007.03.19.23.38.28;	author wieck;	state Exp;
branches;
next	2.145;

2.145
date	2007.02.14.01.58.55;	author tgl;	state Exp;
branches;
next	2.144;

2.144
date	2007.01.31.20.56.16;	author momjian;	state Exp;
branches;
next	2.143;

2.143
date	2007.01.22.01.35.19;	author tgl;	state Exp;
branches;
next	2.142;

2.142
date	2007.01.20.23.13.01;	author tgl;	state Exp;
branches;
next	2.141;

2.141
date	2007.01.09.02.14.09;	author tgl;	state Exp;
branches;
next	2.140;

2.140
date	2006.12.30.21.21.52;	author tgl;	state Exp;
branches;
next	2.139;

2.139
date	2006.12.23.00.43.08;	author tgl;	state Exp;
branches;
next	2.138;

2.138
date	2006.12.18.18.56.28;	author tgl;	state Exp;
branches;
next	2.137;

2.137
date	2006.11.12.06.25.37;	author neilc;	state Exp;
branches
	2.137.2.1;
next	2.136;

2.136
date	2006.11.05.22.42.06;	author tgl;	state Exp;
branches;
next	2.135;

2.135
date	2006.10.23.18.10.30;	author petere;	state Exp;
branches;
next	2.134;

2.134
date	2006.09.22.23.20.13;	author tgl;	state Exp;
branches;
next	2.133;

2.133
date	2006.09.18.22.40.36;	author tgl;	state Exp;
branches;
next	2.132;

2.132
date	2006.09.16.20.14.32;	author tgl;	state Exp;
branches;
next	2.131;

2.131
date	2006.09.16.00.30.11;	author momjian;	state Exp;
branches;
next	2.130;

2.130
date	2006.08.25.04.06.44;	author tgl;	state Exp;
branches;
next	2.129;

2.129
date	2006.07.31.20.08.55;	author tgl;	state Exp;
branches;
next	2.128;

2.128
date	2006.07.27.08.30.41;	author petere;	state Exp;
branches;
next	2.127;

2.127
date	2006.07.25.03.51.21;	author tgl;	state Exp;
branches;
next	2.126;

2.126
date	2006.07.10.16.20.49;	author alvherre;	state Exp;
branches;
next	2.125;

2.125
date	2006.07.03.22.45.36;	author tgl;	state Exp;
branches;
next	2.124;

2.124
date	2006.06.03.02.53.04;	author tgl;	state Exp;
branches;
next	2.123;

2.123
date	2006.05.28.02.27.08;	author alvherre;	state Exp;
branches;
next	2.122;

2.122
date	2006.05.02.22.25.09;	author tgl;	state Exp;
branches;
next	2.121;

2.121
date	2006.03.10.19.10.46;	author momjian;	state Exp;
branches;
next	2.120;

2.120
date	2006.02.12.03.22.16;	author momjian;	state Exp;
branches;
next	2.119;

2.119
date	2006.01.21.19.05.59;	author tgl;	state Exp;
branches;
next	2.118;

2.118
date	2006.01.18.06.49.25;	author neilc;	state Exp;
branches;
next	2.117;

2.117
date	2006.01.16.18.15.30;	author neilc;	state Exp;
branches;
next	2.116;

2.116
date	2006.01.08.07.00.24;	author neilc;	state Exp;
branches;
next	2.115;

2.115
date	2005.11.04.23.13.59;	author petere;	state Exp;
branches;
next	2.114;

2.114
date	2005.09.13.01.51.18;	author alvherre;	state Exp;
branches;
next	2.113;

2.113
date	2005.09.08.20.07.41;	author tgl;	state Exp;
branches;
next	2.112;

2.112
date	2005.08.24.17.24.17;	author tgl;	state Exp;
branches;
next	2.111;

2.111
date	2005.08.11.21.11.41;	author tgl;	state Exp;
branches;
next	2.110;

2.110
date	2005.07.31.17.19.16;	author tgl;	state Exp;
branches;
next	2.109;

2.109
date	2005.07.26.16.38.25;	author tgl;	state Exp;
branches;
next	2.108;

2.108
date	2005.07.14.05.13.38;	author tgl;	state Exp;
branches;
next	2.107;

2.107
date	2005.07.07.20.39.56;	author tgl;	state Exp;
branches;
next	2.106;

2.106
date	2005.06.28.05.08.50;	author tgl;	state Exp;
branches;
next	2.105;

2.105
date	2005.06.18.19.33.41;	author tgl;	state Exp;
branches;
next	2.104;

2.104
date	2005.06.17.22.32.41;	author tgl;	state Exp;
branches;
next	2.103;

2.103
date	2005.06.13.23.14.47;	author tgl;	state Exp;
branches;
next	2.102;

2.102
date	2005.05.17.21.46.09;	author tgl;	state Exp;
branches;
next	2.101;

2.101
date	2005.05.06.14.28.53;	author tgl;	state Exp;
branches;
next	2.100;

2.100
date	2005.04.12.04.26.13;	author tgl;	state Exp;
branches;
next	2.99;

2.99
date	2005.03.29.19.44.22;	author tgl;	state Exp;
branches;
next	2.98;

2.98
date	2005.03.29.00.16.49;	author tgl;	state Exp;
branches;
next	2.97;

2.97
date	2005.03.27.23.52.51;	author tgl;	state Exp;
branches;
next	2.96;

2.96
date	2005.02.13.03.04.15;	author tgl;	state Exp;
branches;
next	2.95;

2.95
date	2005.01.05.23.42.03;	author tgl;	state Exp;
branches;
next	2.94;

2.94
date	2004.12.13.18.05.07;	author petere;	state Exp;
branches;
next	2.93;

2.93
date	2004.12.01.19.00.27;	author tgl;	state Exp;
branches;
next	2.92;

2.92
date	2004.11.15.06.32.13;	author neilc;	state Exp;
branches;
next	2.91;

2.91
date	2004.11.05.19.15.48;	author tgl;	state Exp;
branches;
next	2.90;

2.90
date	2004.10.11.17.24.39;	author tgl;	state Exp;
branches;
next	2.89;

2.89
date	2004.07.04.23.34.23;	author tgl;	state Exp;
branches;
next	2.88;

2.88
date	2004.06.18.06.13.02;	author tgl;	state Exp;
branches;
next	2.87;

2.87
date	2004.06.16.01.26.33;	author tgl;	state Exp;
branches;
next	2.86;

2.86
date	2004.06.07.04.04.47;	author tgl;	state Exp;
branches;
next	2.85;

2.85
date	2004.04.01.21.28.43;	author tgl;	state Exp;
branches;
next	2.84;

2.84
date	2004.02.15.21.01.38;	author tgl;	state Exp;
branches;
next	2.83;

2.83
date	2004.02.12.23.41.00;	author tgl;	state Exp;
branches;
next	2.82;

2.82
date	2004.01.06.23.55.18;	author tgl;	state Exp;
branches;
next	2.81;

2.81
date	2003.12.06.23.10.21;	author joe;	state Exp;
branches;
next	2.80;

2.80
date	2003.11.29.19.51.36;	author pgsql;	state Exp;
branches;
next	2.79;

2.79
date	2003.11.12.21.15.42;	author tgl;	state Exp;
branches;
next	2.78;

2.78
date	2003.11.02.12.53.57;	author petere;	state Exp;
branches;
next	2.77;

2.77
date	2003.11.01.01.56.28;	author petere;	state Exp;
branches;
next	2.76;

2.76
date	2003.10.17.22.38.20;	author tgl;	state Exp;
branches;
next	2.75;

2.75
date	2003.10.17.00.55.17;	author tgl;	state Exp;
branches;
next	2.74;

2.74
date	2003.09.12.22.17.19;	author tgl;	state Exp;
branches;
next	2.73;

2.73
date	2003.06.25.01.14.37;	author momjian;	state Exp;
branches;
next	2.72;

2.72
date	2003.06.22.22.04.54;	author tgl;	state Exp;
branches;
next	2.71;

2.71
date	2003.05.28.16.03.55;	author tgl;	state Exp;
branches;
next	2.70;

2.70
date	2003.05.08.22.19.55;	author tgl;	state Exp;
branches;
next	2.69;

2.69
date	2003.04.15.13.23.35;	author petere;	state Exp;
branches;
next	2.68;

2.68
date	2003.03.25.16.15.35;	author petere;	state Exp;
branches;
next	2.67;

2.67
date	2003.03.23.05.14.36;	author tgl;	state Exp;
branches;
next	2.66;

2.66
date	2003.02.22.00.45.03;	author tgl;	state Exp;
branches;
next	2.65;

2.65
date	2003.01.19.00.13.28;	author momjian;	state Exp;
branches;
next	2.64;

2.64
date	2002.12.17.17.41.30;	author momjian;	state Exp;
branches;
next	2.63;

2.63
date	2002.10.14.04.29.23;	author momjian;	state Exp;
branches;
next	2.62;

2.62
date	2002.09.24.21.26.44;	author tgl;	state Exp;
branches;
next	2.61;

2.61
date	2002.09.22.19.42.50;	author tgl;	state Exp;
branches;
next	2.60;

2.60
date	2002.09.18.21.35.20;	author tgl;	state Exp;
branches;
next	2.59;

2.59
date	2002.09.03.01.04.40;	author tgl;	state Exp;
branches;
next	2.58;

2.58
date	2002.09.02.05.52.34;	author momjian;	state Exp;
branches;
next	2.57;

2.57
date	2002.09.02.05.44.43;	author momjian;	state Exp;
branches;
next	2.56;

2.56
date	2002.08.30.19.23.18;	author tgl;	state Exp;
branches;
next	2.55;

2.55
date	2002.08.28.15.02.55;	author tgl;	state Exp;
branches;
next	2.54;

2.54
date	2002.08.24.15.00.45;	author tgl;	state Exp;
branches;
next	2.53;

2.53
date	2002.08.13.17.22.08;	author petere;	state Exp;
branches;
next	2.52;

2.52
date	2002.08.05.02.30.46;	author tgl;	state Exp;
branches;
next	2.51;

2.51
date	2002.08.02.18.15.04;	author tgl;	state Exp;
branches;
next	2.50;

2.50
date	2002.07.31.17.19.49;	author tgl;	state Exp;
branches;
next	2.49;

2.49
date	2002.07.30.05.24.56;	author tgl;	state Exp;
branches;
next	2.48;

2.48
date	2002.07.24.19.11.06;	author petere;	state Exp;
branches;
next	2.47;

2.47
date	2002.07.24.05.51.55;	author ishii;	state Exp;
branches;
next	2.46;

2.46
date	2002.07.22.20.23.19;	author petere;	state Exp;
branches;
next	2.45;

2.45
date	2002.07.12.18.43.12;	author tgl;	state Exp;
branches;
next	2.44;

2.44
date	2002.06.20.15.44.06;	author momjian;	state Exp;
branches;
next	2.43;

2.43
date	2002.04.21.00.26.42;	author tgl;	state Exp;
branches;
next	2.42;

2.42
date	2002.04.16.23.08.09;	author tgl;	state Exp;
branches;
next	2.41;

2.41
date	2002.04.11.19.59.54;	author tgl;	state Exp;
branches;
next	2.40;

2.40
date	2002.04.05.00.31.22;	author tgl;	state Exp;
branches;
next	2.39;

2.39
date	2002.03.29.19.05.57;	author tgl;	state Exp;
branches;
next	2.38;

2.38
date	2002.03.26.19.15.10;	author tgl;	state Exp;
branches;
next	2.37;

2.37
date	2002.03.22.21.34.43;	author tgl;	state Exp;
branches;
next	2.36;

2.36
date	2002.03.22.19.20.03;	author petere;	state Exp;
branches;
next	2.35;

2.35
date	2002.03.20.19.43.24;	author tgl;	state Exp;
branches;
next	2.34;

2.34
date	2002.03.19.02.18.10;	author momjian;	state Exp;
branches;
next	2.33;

2.33
date	2002.03.07.16.35.32;	author momjian;	state Exp;
branches;
next	2.32;

2.32
date	2002.03.06.20.34.43;	author momjian;	state Exp;
branches;
next	2.31;

2.31
date	2002.03.01.22.45.03;	author petere;	state Exp;
branches;
next	2.30;

2.30
date	2002.02.18.23.10.59;	author petere;	state Exp;
branches;
next	2.29;

2.29
date	2001.11.21.05.53.40;	author thomas;	state Exp;
branches;
next	2.28;

2.28
date	2001.11.08.23.44.01;	author petere;	state Exp;
branches;
next	2.27;

2.27
date	2001.11.03.21.42.47;	author tgl;	state Exp;
branches;
next	2.26;

2.26
date	2001.10.15.22.47.47;	author tgl;	state Exp;
branches;
next	2.25;

2.25
date	2001.09.13.15.55.22;	author petere;	state Exp;
branches;
next	2.24;

2.24
date	2001.09.10.05.46.41;	author ishii;	state Exp;
branches;
next	2.23;

2.23
date	2001.09.06.02.07.41;	author tgl;	state Exp;
branches;
next	2.22;

2.22
date	2001.08.26.16.55.58;	author tgl;	state Exp;
branches;
next	2.21;

2.21
date	2001.08.21.16.35.58;	author tgl;	state Exp;
branches;
next	2.20;

2.20
date	2001.08.10.18.57.32;	author tgl;	state Exp;
branches;
next	2.19;

2.19
date	2001.07.15.22.48.15;	author tgl;	state Exp;
branches;
next	2.18;

2.18
date	2001.06.12.05.55.48;	author tgl;	state Exp;
branches;
next	2.17;

2.17
date	2001.05.14.20.30.19;	author momjian;	state Exp;
branches;
next	2.16;

2.16
date	2001.05.07.00.43.14;	author tgl;	state Exp;
branches;
next	2.15;

2.15
date	2001.04.20.15.52.33;	author thomas;	state Exp;
branches;
next	2.14;

2.14
date	2001.03.24.23.03.26;	author petere;	state Exp;
branches;
next	2.13;

2.13
date	2000.12.22.18.57.49;	author petere;	state Exp;
branches;
next	2.12;

2.12
date	2000.12.11.18.26.37;	author momjian;	state Exp;
branches;
next	2.11;

2.11
date	2000.12.10.22.37.27;	author momjian;	state Exp;
branches;
next	2.10;

2.10
date	2000.12.10.22.35.56;	author momjian;	state Exp;
branches;
next	2.9;

2.9
date	2000.12.07.22.37.08;	author petere;	state Exp;
branches;
next	2.8;

2.8
date	2000.11.29.20.15.58;	author petere;	state Exp;
branches;
next	2.7;

2.7
date	2000.07.17.03.04.40;	author tgl;	state Exp;
branches;
next	2.6;

2.6
date	2000.06.09.01.43.56;	author momjian;	state Exp;
branches;
next	2.5;

2.5
date	2000.02.17.03.39.39;	author tgl;	state Exp;
branches;
next	2.4;

2.4
date	2000.02.06.05.09.31;	author momjian;	state Exp;
branches;
next	2.3;

2.3
date	2000.01.22.23.50.08;	author tgl;	state Exp;
branches;
next	2.2;

2.2
date	2000.01.11.01.40.04;	author tgl;	state Exp;
branches;
next	2.1;

2.1
date	99.07.22.15.11.03;	author thomas;	state Exp;
branches;
next	;

2.137.2.1
date	2008.01.31.18.40.09;	author tgl;	state Exp;
branches;
next	;

2.200.2.1
date	2009.07.01.23.57.45;	author tgl;	state Exp;
branches;
next	2.200.2.2;

2.200.2.2
date	2009.08.10.22.16.11;	author alvherre;	state Exp;
branches;
next	;

2.225.2.1
date	2010.08.17.04.37.15;	author petere;	state Exp;
branches;
next	2.225.2.2;

2.225.2.2
date	2010.08.25.18.18.38;	author petere;	state Exp;
branches;
next	2.225.2.3;

2.225.2.3
date	2010.09.13.01.25.12;	author rhaas;	state Exp;
branches;
next	2.225.2.4;

2.225.2.4
date	2010.09.13.17.03.23;	author rhaas;	state Exp;
branches;
next	2.225.2.5;

2.225.2.5
date	2010.09.17.18.50.22;	author rhaas;	state Exp;
branches;
next	;


desc
@@


2.231
log
@Move pg_db_role_setting docs to correct place in alphabetical order.
@
text
@<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.230 2010/09/13 17:02:34 rhaas Exp $ -->
<!--
 Documentation of the system catalogs, directed toward PostgreSQL developers
 -->

<chapter id="catalogs">
 <title>System Catalogs</title>

  <para>
   The system catalogs are the place where a relational database
   management system stores schema metadata, such as information about
   tables and columns, and internal bookkeeping information.
   <productname>PostgreSQL</productname>'s system catalogs are regular
   tables.  You can drop and recreate the tables, add columns, insert
   and update values, and severely mess up your system that way.
   Normally, one should not change the system catalogs by hand, there
   are always SQL commands to do that.  (For example, <command>CREATE
   DATABASE</command> inserts a row into the
   <structname>pg_database</structname> catalog &mdash; and actually
   creates the database on disk.)  There are some exceptions for
   particularly esoteric operations, such as adding index access methods.
  </para>

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

  <para>
   <xref linkend="catalog-table"> lists the system catalogs.
   More detailed documentation of each catalog follows below.
  </para>

  <para>
   Most system catalogs are copied from the template database during
   database creation and are thereafter database-specific. A few
   catalogs are physically shared across all databases in a cluster;
   these are noted in the descriptions of the individual catalogs.
  </para>

  <table id="catalog-table">
   <title>System Catalogs</title>

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

    <tbody>
     <row>
      <entry><link linkend="catalog-pg-aggregate"><structname>pg_aggregate</structname></link></entry>
      <entry>aggregate functions</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-am"><structname>pg_am</structname></link></entry>
      <entry>index access methods</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-amop"><structname>pg_amop</structname></link></entry>
      <entry>access method operators</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link></entry>
      <entry>access method support procedures</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link></entry>
      <entry>column default values</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link></entry>
      <entry>table columns (<quote>attributes</quote>)</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link></entry>
      <entry>authorization identifiers (roles)</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link></entry>
      <entry>authorization identifier membership relationships</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-cast"><structname>pg_cast</structname></link></entry>
      <entry>casts (data type conversions)</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-class"><structname>pg_class</structname></link></entry>
      <entry>tables, indexes, sequences, views (<quote>relations</quote>)</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link></entry>
      <entry>check constraints, unique constraints, primary key constraints, foreign key constraints</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-conversion"><structname>pg_conversion</structname></link></entry>
      <entry>encoding conversion information</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-database"><structname>pg_database</structname></link></entry>
      <entry>databases within this database cluster</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-db-role-setting"><structname>pg_db_role_setting</structname></link></entry>
      <entry>per-role and per-database settings</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-default-acl"><structname>pg_default_acl</structname></link></entry>
      <entry>default privileges for object types</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-depend"><structname>pg_depend</structname></link></entry>
      <entry>dependencies between database objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-description"><structname>pg_description</structname></link></entry>
      <entry>descriptions or comments on database objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-enum"><structname>pg_enum</structname></link></entry>
      <entry>enum label and value definitions</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link></entry>
      <entry>foreign-data wrapper definitions</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link></entry>
      <entry>foreign server definitions</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-index"><structname>pg_index</structname></link></entry>
      <entry>additional index information</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-inherits"><structname>pg_inherits</structname></link></entry>
      <entry>table inheritance hierarchy</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-language"><structname>pg_language</structname></link></entry>
      <entry>languages for writing functions</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-largeobject"><structname>pg_largeobject</structname></link></entry>
      <entry>data pages for large objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link></entry>
      <entry>metadata for large objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link></entry>
      <entry>schemas</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link></entry>
      <entry>access method operator classes</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link></entry>
      <entry>operators</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link></entry>
      <entry>access method operator families</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-pltemplate"><structname>pg_pltemplate</structname></link></entry>
      <entry>template data for procedural languages</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link></entry>
      <entry>functions and procedures</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link></entry>
      <entry>query rewrite rules</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link></entry>
      <entry>dependencies on shared objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link></entry>
      <entry>comments on shared objects</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link></entry>
      <entry>planner statistics</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link></entry>
      <entry>tablespaces within this database cluster</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link></entry>
      <entry>triggers</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link></entry>
      <entry>text search configurations</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link></entry>
      <entry>text search configurations' token mappings</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link></entry>
      <entry>text search dictionaries</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link></entry>
      <entry>text search parsers</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link></entry>
      <entry>text search templates</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-type"><structname>pg_type</structname></link></entry>
      <entry>data types</entry>
     </row>

     <row>
      <entry><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link></entry>
      <entry>mappings of users to foreign servers</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-aggregate">
  <title><structname>pg_aggregate</structname></title>

  <indexterm zone="catalog-pg-aggregate">
   <primary>pg_aggregate</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_aggregate</structname> stores information about
   aggregate functions.  An aggregate function is a function that
   operates on a set of values (typically one column from each row
   that matches a query condition) and returns a single value computed
   from all these values.  Typical aggregate functions are
   <function>sum</function>, <function>count</function>, and
   <function>max</function>.  Each entry in
   <structname>pg_aggregate</structname> is an extension of an entry
   in <structname>pg_proc</structname>.  The <structname>pg_proc</structname>
   entry carries the aggregate's name, input and output data types, and
   other information that is similar to ordinary functions.
  </para>

  <table>
   <title><structname>pg_aggregate</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>aggfnoid</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><structname>pg_proc</structname> OID of the aggregate function</entry>
     </row>
     <row>
      <entry><structfield>aggtransfn</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Transition function</entry>
     </row>
     <row>
      <entry><structfield>aggfinalfn</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Final function (zero if none)</entry>
     </row>
     <row>
      <entry><structfield>aggsortop</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>Associated sort operator (zero if none)</entry>
     </row>
     <row>
      <entry><structfield>aggtranstype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Data type of the aggregate function's internal transition (state) data</entry>
     </row>
     <row>
      <entry><structfield>agginitval</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       The initial value of the transition state.  This is a text
       field containing the initial value in its external string
       representation.  If this field is null, the transition state
       value starts out null.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   New aggregate functions are registered with the <xref
   linkend="sql-createaggregate">
   command.  See <xref linkend="xaggr"> for more information about
   writing aggregate functions and the meaning of the transition
   functions, etc.
  </para>

 </sect1>


 <sect1 id="catalog-pg-am">
  <title><structname>pg_am</structname></title>

  <indexterm zone="catalog-pg-am">
   <primary>pg_am</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_am</structname> stores information about index
   access methods.  There is one row for each index access method supported by
   the system.  The contents of this catalog are discussed in detail in
   <xref linkend="indexam">.
  </para>

  <table>
   <title><structname>pg_am</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>amname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the access method</entry>
     </row>

     <row>
      <entry><structfield>amstrategies</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Number of operator strategies for this access method,
       or zero if access method does not have a fixed set of operator
       strategies</entry>
     </row>

     <row>
      <entry><structfield>amsupport</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Number of support routines for this access method</entry>
     </row>

     <row>
      <entry><structfield>amcanorder</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support ordered scans?</entry>
     </row>

     <row>
      <entry><structfield>amcanbackward</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support backward scanning?</entry>
     </row>

     <row>
      <entry><structfield>amcanunique</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support unique indexes?</entry>
     </row>

     <row>
      <entry><structfield>amcanmulticol</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support multicolumn indexes?</entry>
     </row>

     <row>
      <entry><structfield>amoptionalkey</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support a scan without any constraint
       for the first index column?</entry>
     </row>

     <row>
      <entry><structfield>amindexnulls</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support null index entries?</entry>
     </row>

     <row>
      <entry><structfield>amsearchnulls</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support <literal>IS NULL</>/<literal>NOT NULL</> searches?</entry>
     </row>

     <row>
      <entry><structfield>amstorage</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Can index storage data type differ from column data type?</entry>
     </row>

     <row>
      <entry><structfield>amclusterable</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Can an index of this type be clustered on?</entry>
     </row>

     <row>
      <entry><structfield>amkeytype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Type of data stored in index, or zero if not a fixed type</entry>
     </row>

     <row>
      <entry><structfield>aminsert</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Insert this tuple</quote> function</entry>
     </row>

     <row>
      <entry><structfield>ambeginscan</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Start new scan</quote> function</entry>
     </row>

     <row>
      <entry><structfield>amgettuple</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Next valid tuple</quote> function, or zero if none</entry>
     </row>

     <row>
      <entry><structfield>amgetbitmap</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Fetch all valid tuples</quote> function, or zero if none</entry>
     </row>

     <row>
      <entry><structfield>amrescan</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Restart this scan</quote> function</entry>
     </row>

     <row>
      <entry><structfield>amendscan</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>End this scan</quote> function</entry>
     </row>

     <row>
      <entry><structfield>ammarkpos</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Mark current scan position</quote> function</entry>
     </row>

     <row>
      <entry><structfield>amrestrpos</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Restore marked scan position</quote> function</entry>
     </row>

     <row>
      <entry><structfield>ambuild</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry><quote>Build new index</quote> function</entry>
     </row>

     <row>
      <entry><structfield>ambulkdelete</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Bulk-delete function</entry>
     </row>

     <row>
      <entry><structfield>amvacuumcleanup</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Post-<command>VACUUM</command> cleanup function</entry>
     </row>

     <row>
      <entry><structfield>amcostestimate</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Function to estimate cost of an index scan</entry>
     </row>

     <row>
      <entry><structfield>amoptions</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Function to parse and validate <structfield>reloptions</> for an index</entry>
     </row>

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

 </sect1>


 <sect1 id="catalog-pg-amop">
  <title><structname>pg_amop</structname></title>

  <indexterm zone="catalog-pg-amop">
   <primary>pg_amop</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_amop</structname> stores information about
   operators associated with access method operator families.  There is one
   row for each operator that is a member of an operator family.  An operator
   can appear in more than one family, but cannot appear in more than one
   position within a family.
  </para>

  <table>
   <title><structname>pg_amop</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>amopfamily</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
      <entry>The operator family this entry is for</entry>
     </row>

     <row>
      <entry><structfield>amoplefttype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Left-hand input data type of operator</entry>
     </row>

     <row>
      <entry><structfield>amoprighttype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Right-hand input data type of operator</entry>
     </row>

     <row>
      <entry><structfield>amopstrategy</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Operator strategy number</entry>
     </row>

     <row>
      <entry><structfield>amopopr</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>OID of the operator</entry>
     </row>

     <row>
      <entry><structfield>amopmethod</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
      <entry>Index access method operator family is for</entry>
     </row>

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

  <para>
   An entry's <structfield>amopmethod</> must match the
   <structname>opfmethod</> of its containing operator family (including
   <structfield>amopmethod</> here is an intentional denormalization of the
   catalog structure for performance reasons).  Also,
   <structfield>amoplefttype</> and <structfield>amoprighttype</> must match
   the <structfield>oprleft</> and <structfield>oprright</> fields of the
   referenced <structname>pg_operator</> entry.
  </para>

 </sect1>


 <sect1 id="catalog-pg-amproc">
  <title><structname>pg_amproc</structname></title>

  <indexterm zone="catalog-pg-amproc">
   <primary>pg_amproc</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_amproc</structname> stores information about
   support procedures associated with access method operator families.  There
   is one row for each support procedure belonging to an operator family.
  </para>

  <table>
   <title><structname>pg_amproc</structname> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>amprocfamily</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
      <entry>The operator family this entry is for</entry>
     </row>

     <row>
      <entry><structfield>amproclefttype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Left-hand input data type of associated operator</entry>
     </row>

     <row>
      <entry><structfield>amprocrighttype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Right-hand input data type of associated operator</entry>
     </row>

     <row>
      <entry><structfield>amprocnum</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Support procedure number</entry>
     </row>

     <row>
      <entry><structfield>amproc</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the procedure</entry>
     </row>

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

  <para>
   The usual interpretation of the
   <structfield>amproclefttype</> and <structfield>amprocrighttype</> fields
   is that they identify the left and right input types of the operator(s)
   that a particular support procedure supports.  For some access methods
   these match the input data type(s) of the support procedure itself, for
   others not.  There is a notion of <quote>default</> support procedures for
   an index, which are those with <structfield>amproclefttype</> and
   <structfield>amprocrighttype</> both equal to the index opclass's
   <structfield>opcintype</>.
  </para>

 </sect1>


 <sect1 id="catalog-pg-attrdef">
  <title><structname>pg_attrdef</structname></title>

  <indexterm zone="catalog-pg-attrdef">
   <primary>pg_attrdef</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_attrdef</structname> stores column default values.  The main information
   about columns is stored in <structname>pg_attribute</structname>
   (see below).  Only columns that explicitly specify a default value
   (when the table is created or the column is added) will have an
   entry here.
  </para>

  <table>
   <title><structname>pg_attrdef</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>adrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this column belongs to</entry>
     </row>

     <row>
      <entry><structfield>adnum</structfield></entry>
      <entry><type>int2</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
      <entry>The number of the column</entry>
     </row>

     <row>
      <entry><structfield>adbin</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>The internal representation of the column default value</entry>
     </row>

     <row>
      <entry><structfield>adsrc</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>A human-readable representation of the default value</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

   <para>
    The <structfield>adsrc</structfield> field is historical, and is best
    not used, because it does not track outside changes that might affect
    the representation of the default value.  Reverse-compiling the
    <structfield>adbin</structfield> field (with <function>pg_get_expr</> for
    example) is a better way to display the default value.
   </para>

 </sect1>


 <sect1 id="catalog-pg-attribute">
  <title><structname>pg_attribute</structname></title>

  <indexterm zone="catalog-pg-attribute">
   <primary>pg_attribute</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_attribute</structname> stores information about
   table columns.  There will be exactly one
   <structname>pg_attribute</structname> row for every column in every
   table in the database.  (There will also be attribute entries for
   indexes, and indeed all objects that have <structname>pg_class</structname>
   entries.)
  </para>

  <para>
   The term attribute is equivalent to column and is used for
   historical reasons.
  </para>

  <table>
   <title><structname>pg_attribute</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>attrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this column belongs to</entry>
     </row>

     <row>
      <entry><structfield>attname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>The column name</entry>
     </row>

     <row>
      <entry><structfield>atttypid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>The data type of this column</entry>
     </row>

     <row>
      <entry><structfield>attstattarget</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       <structfield>attstattarget</structfield> controls the level of detail
       of statistics accumulated for this column by
       <xref linkend="sql-analyze">.
       A zero value indicates that no statistics should be collected.
       A negative value says to use the system default statistics target.
       The exact meaning of positive values is data type-dependent.
       For scalar data types, <structfield>attstattarget</structfield>
       is both the target number of <quote>most common values</quote>
       to collect, and the target number of histogram bins to create.
      </entry>
     </row>

     <row>
      <entry><structfield>attlen</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       A copy of <literal>pg_type.typlen</literal> of this column's
       type
      </entry>
     </row>

     <row>
      <entry><structfield>attnum</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       The number of the column.  Ordinary columns are numbered from 1
       up.  System columns, such as <structfield>oid</structfield>,
       have (arbitrary) negative numbers.
      </entry>
     </row>

     <row>
      <entry><structfield>attndims</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       Number of dimensions, if the column is an array type; otherwise 0.
       (Presently, the number of dimensions of an array is not enforced,
       so any nonzero value effectively means <quote>it's an array</>.)
      </entry>
     </row>

     <row>
      <entry><structfield>attcacheoff</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       Always -1 in storage, but when loaded into a row descriptor
       in memory this might be updated to cache the offset of the attribute
       within the row
      </entry>
     </row>

     <row>
      <entry><structfield>atttypmod</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       <structfield>atttypmod</structfield> records type-specific data
       supplied at table creation time (for example, the maximum
       length of a <type>varchar</type> column).  It is passed to
       type-specific input functions and length coercion functions.
       The value will generally be -1 for types that do not need <structfield>atttypmod</>.
      </entry>
     </row>

     <row>
      <entry><structfield>attbyval</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       A copy of <literal>pg_type.typbyval</> of this column's type
      </entry>
     </row>

     <row>
      <entry><structfield>attstorage</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Normally a copy of <literal>pg_type.typstorage</> of this
       column's type.  For TOAST-able data types, this can be altered
       after column creation to control storage policy.
      </entry>
     </row>

     <row>
      <entry><structfield>attalign</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       A copy of <literal>pg_type.typalign</> of this column's type
      </entry>
     </row>

     <row>
      <entry><structfield>attnotnull</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This represents a not-null constraint.  It is possible to
       change this column to enable or disable the constraint.
      </entry>
     </row>

     <row>
      <entry><structfield>atthasdef</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This column has a default value, in which case there will be a
       corresponding entry in the <structname>pg_attrdef</structname>
       catalog that actually defines the value.
      </entry>
     </row>

     <row>
      <entry><structfield>attisdropped</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This column has been dropped and is no longer valid.  A dropped
       column is still physically present in the table, but is
       ignored by the parser and so cannot be accessed via SQL.
      </entry>
     </row>

     <row>
      <entry><structfield>attislocal</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This column is defined locally in the relation.  Note that a column can
       be locally defined and inherited simultaneously.
      </entry>
     </row>

     <row>
      <entry><structfield>attinhcount</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       The number of direct ancestors this column has.  A column with a
       nonzero number of ancestors cannot be dropped nor renamed.
      </entry>
     </row>

     <row>
      <entry><structfield>attacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Column-level access privileges, if any have been granted specifically
       on this column
      </entry>
     </row>

     <row>
      <entry><structfield>attoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       Attribute-level options, as <quote>keyword=value</> strings
      </entry>
     </row>

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

  <para>
   In a dropped column's <structname>pg_attribute</structname> entry,
   <structfield>atttypid</structfield> is reset to zero, but
   <structfield>attlen</structfield> and the other fields copied from
   <structname>pg_type</> are still valid.  This arrangement is needed
   to cope with the situation where the dropped column's data type was
   later dropped, and so there is no <structname>pg_type</> row anymore.
   <structfield>attlen</structfield> and the other fields can be used
   to interpret the contents of a row of the table.
  </para>
 </sect1>


 <sect1 id="catalog-pg-authid">
  <title><structname>pg_authid</structname></title>

  <indexterm zone="catalog-pg-authid">
   <primary>pg_authid</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_authid</structname> contains information about
   database authorization identifiers (roles).  A role subsumes the concepts
   of <quote>users</> and <quote>groups</>.  A user is essentially just a
   role with the <structfield>rolcanlogin</> flag set.  Any role (with or
   without <structfield>rolcanlogin</>) can have other roles as members; see
   <link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>.
  </para>

  <para>
   Since this catalog contains passwords, it must not be publicly readable.
   <link linkend="view-pg-roles"><structname>pg_roles</structname></link>
   is a publicly readable view on
   <structname>pg_authid</structname> that blanks out the password field.
  </para>

  <para>
   <xref linkend="user-manag"> contains detailed information about user and
   privilege management.
  </para>

  <para>
   Because user identities are cluster-wide,
   <structname>pg_authid</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_authid</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_authid</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>rolname</structfield></entry>
      <entry><type>name</type></entry>
      <entry>Role name</entry>
     </row>

     <row>
      <entry><structfield>rolsuper</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>Role has superuser privileges</entry>
     </row>

     <row>
      <entry><structfield>rolinherit</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>Role automatically inherits privileges of roles it is a
       member of</entry>
     </row>

     <row>
      <entry><structfield>rolcreaterole</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>Role can create more roles</entry>
     </row>

     <row>
      <entry><structfield>rolcreatedb</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>Role can create databases</entry>
     </row>

     <row>
      <entry><structfield>rolcatupdate</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>
       Role can update system catalogs directly.  (Even a superuser cannot do
       this unless this column is true)
      </entry>
     </row>

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

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

     <row>
      <entry><structfield>rolpassword</structfield></entry>
      <entry><type>text</type></entry>
      <entry>
       Password (possibly encrypted); null if none.  If the password is
       encrypted, this column will contain the string md5 followed by a
       32-character hexadecimal MD5 hash.  The MD5 hash will be of the
       user's password concatenated to their username (for example, if
       user joe has password xyzzy, <productname>PostgreSQL</> will store
       the md5 hash of xyzzyjoe).
      </entry>
     </row>

     <row>
      <entry><structfield>rolvaliduntil</structfield></entry>
      <entry><type>timestamptz</type></entry>
      <entry>Password expiry time (only used for password authentication);
       null if no expiration</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-auth-members">
  <title><structname>pg_auth_members</structname></title>

  <indexterm zone="catalog-pg-auth-members">
   <primary>pg_auth_members</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_auth_members</structname> shows the membership
   relations between roles.  Any non-circular set of relationships is allowed.
  </para>

  <para>
   Because user identities are cluster-wide,
   <structname>pg_auth_members</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_auth_members</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_auth_members</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>roleid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of a role that has a member</entry>
     </row>

     <row>
      <entry><structfield>member</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of a role that is a member of <structfield>roleid</></entry>
     </row>

     <row>
      <entry><structfield>grantor</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of the role that granted this membership</entry>
     </row>

     <row>
      <entry><structfield>admin_option</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if <structfield>member</> can grant membership in
       <structfield>roleid</> to others</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-cast">
  <title><structname>pg_cast</structname></title>

  <indexterm zone="catalog-pg-cast">
   <primary>pg_cast</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_cast</structname> stores data type conversion
   paths, both built-in paths and those defined with
   <xref linkend="sql-createcast">.
  </para>

  <para>
   It should be noted that <structname>pg_cast</structname> does not represent
   every type conversion that the system knows how to perform; only those that
   cannot be deduced from some generic rule.  For example, casting between a
   domain and its base type is not explicitly represented in
   <structname>pg_cast</structname>.  Another important exception is that
   <quote>automatic I/O conversion casts</>, those performed using a data
   type's own I/O functions to convert to or from <type>text</> or other
   string types, are not explicitly represented in
   <structname>pg_cast</structname>.
  </para>

  <table>
   <title><structname>pg_cast</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>castsource</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>OID of the source data type</entry>
     </row>

     <row>
      <entry><structfield>casttarget</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>OID of the target data type</entry>
     </row>

     <row>
      <entry><structfield>castfunc</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>
       The OID of the function to use to perform this cast.  Zero is
       stored if the cast method doesn't require a function.
      </entry>
     </row>

     <row>
      <entry><structfield>castcontext</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Indicates what contexts the cast can be invoked in.
       <literal>e</> means only as an explicit cast (using
       <literal>CAST</> or <literal>::</> syntax).
       <literal>a</> means implicitly in assignment
       to a target column, as well as explicitly.
       <literal>i</> means implicitly in expressions, as well as the
       other cases.
      </entry>
     </row>
     <row>
      <entry><structfield>castmethod</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Indicates how the cast is performed.
       <literal>f</> means that the function specified in the <structfield>castfunc</> field is used.
       <literal>i</> means that the input/output functions are used.
       <literal>b</> means that the types are binary-coercible, thus no conversion is required.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The cast functions listed in <structname>pg_cast</structname> must
   always take the cast source type as their first argument type, and
   return the cast destination type as their result type.  A cast
   function can have up to three arguments.  The second argument,
   if present, must be type <type>integer</>; it receives the type
   modifier associated with the destination type, or <literal>-1</>
   if there is none.  The third argument,
   if present, must be type <type>boolean</>; it receives <literal>true</>
   if the cast is an explicit cast, <literal>false</> otherwise.
  </para>

  <para>
   It is legitimate to create a <structname>pg_cast</structname> entry
   in which the source and target types are the same, if the associated
   function takes more than one argument.  Such entries represent
   <quote>length coercion functions</> that coerce values of the type
   to be legal for a particular type modifier value.
  </para>

  <para>
   When a <structname>pg_cast</structname> entry has different source and
   target types and a function that takes more than one argument, it
   represents converting from one type to another and applying a length
   coercion in a single step.  When no such entry is available, coercion
   to a type that uses a type modifier involves two steps, one to
   convert between data types and a second to apply the modifier.
  </para>
 </sect1>

 <sect1 id="catalog-pg-class">
  <title><structname>pg_class</structname></title>

  <indexterm zone="catalog-pg-class">
   <primary>pg_class</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_class</structname> catalogs tables and most
   everything else that has columns or is otherwise similar to a
   table.  This includes indexes (but see also
   <structname>pg_index</structname>), sequences, views, composite types,
   and TOAST tables; see <structfield>relkind</>.
   Below, when we mean all of these
   kinds of objects we speak of <quote>relations</quote>.  Not all
   columns are meaningful for all relation types.
  </para>

  <table>
   <title><structname>pg_class</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>relname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the table, index, view, etc.</entry>
     </row>

     <row>
      <entry><structfield>relnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this relation
      </entry>
     </row>

     <row>
      <entry><structfield>reltype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       The OID of the data type that corresponds to this table's row type,
       if any (zero for indexes, which have no <structname>pg_type</> entry)
      </entry>
     </row>

     <row>
      <entry><structfield>reloftype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       For typed tables, the OID of the underlying composite type,
       zero for all other relations
      </entry>
     </row>

     <row>
      <entry><structfield>relowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the relation</entry>
     </row>

     <row>
      <entry><structfield>relam</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
      <entry>If this is an index, the access method used (B-tree, hash, etc.)</entry>
     </row>

     <row>
      <entry><structfield>relfilenode</structfield></entry>
      <entry><type>oid</type></entry>
      <entry></entry>
      <entry>Name of the on-disk file of this relation; zero means this
       is a <quote>mapped</> relation whose disk file name is determined
       by low-level state</entry>
     </row>

     <row>
      <entry><structfield>reltablespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
      <entry>
       The tablespace in which this relation is stored.  If zero,
       the database's default tablespace is implied.  (Not meaningful
       if the relation has no on-disk file.)
      </entry>
     </row>

     <row>
      <entry><structfield>relpages</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       Size of the on-disk representation of this table in pages (of size
       <symbol>BLCKSZ</symbol>).  This is only an estimate used by the
       planner.  It is updated by <command>VACUUM</command>,
       <command>ANALYZE</command>, and a few DDL commands such as
       <command>CREATE INDEX</command>.
      </entry>
     </row>

     <row>
      <entry><structfield>reltuples</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>
       Number of rows in the table.  This is only an estimate used by the
       planner.  It is updated by <command>VACUUM</command>,
       <command>ANALYZE</command>, and a few DDL commands such as
       <command>CREATE INDEX</command>.
      </entry>
     </row>

     <row>
      <entry><structfield>reltoastrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       OID of the TOAST table associated with this table, 0 if none.  The
       TOAST table stores large attributes <quote>out of line</quote> in a
       secondary table.
      </entry>
     </row>

     <row>
      <entry><structfield>reltoastidxid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       For a TOAST table, the OID of its index.  0 if not a TOAST table.
      </entry>
     </row>

     <row>
      <entry><structfield>relhasindex</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if this is a table and it has (or recently had) any indexes
      </entry>
     </row>

     <row>
      <entry><structfield>relisshared</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if this table is shared across all databases in the cluster.  Only
       certain system catalogs (such as <structname>pg_database</structname>)
       are shared.
      </entry>
     </row>

     <row>
      <entry><structfield>relistemp</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if this table is a temporary relation.  If so, only the creating
       session can safely access its contents.
      </entry>
     </row>

     <row>
      <entry><structfield>relkind</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       <literal>r</> = ordinary table, <literal>i</> = index,
       <literal>S</> = sequence, <literal>v</> = view, <literal>c</> =
       composite type, <literal>t</> = TOAST
       table
      </entry>
     </row>

     <row>
      <entry><structfield>relnatts</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       Number of user columns in the relation (system columns not
       counted).  There must be this many corresponding entries in
       <structname>pg_attribute</structname>.  See also
       <literal>pg_attribute.attnum</literal>.
      </entry>
     </row>

     <row>
      <entry><structfield>relchecks</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       Number of <literal>CHECK</> constraints on the table; see
       <link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link> catalog
      </entry>
     </row>

     <row>
      <entry><structfield>relhasoids</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if we generate an OID for each row of the relation
      </entry>
     </row>

     <row>
      <entry><structfield>relhaspkey</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if the table has (or once had) a primary key
      </entry>
     </row>

     <row>
      <entry><structfield>relhasexclusion</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       For a table, true if the table has (or once had) any exclusion
       constraints; for an index, true if the index supports an exclusion
       constraint
      </entry>
     </row>

     <row>
      <entry><structfield>relhasrules</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if table has (or once had) rules; see
       <link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
      </entry>
     </row>

     <row>
      <entry><structfield>relhastriggers</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if table has (or once had) triggers; see
       <link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
      </entry>
     </row>

     <row>
      <entry><structfield>relhassubclass</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if table has (or once had) any inheritance children</entry>
     </row>

     <row>
      <entry><structfield>relfrozenxid</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       All transaction IDs before this one have been replaced with a permanent
       (<quote>frozen</>) transaction ID in this table.  This is used to track
       whether the table needs to be vacuumed in order to prevent transaction
       ID wraparound or to allow <literal>pg_clog</> to be shrunk.  Zero
       (<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
      </entry>
     </row>

     <row>
      <entry><structfield>relacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>

     <row>
      <entry><structfield>reloptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       Access-method-specific options, as <quote>keyword=value</> strings
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Several of the Boolean flags in <structname>pg_class</> are maintained
   lazily: they are guaranteed to be true if that's the correct state, but
   may not be reset to false immediately when the condition is no longer
   true.  For example, <structfield>relhasindex</> is set by
   <command>CREATE INDEX</command>, but it is never cleared by
   <command>DROP INDEX</command>.  Instead, <command>VACUUM</command> clears
   <structfield>relhasindex</> if it finds the table has no indexes.  This
   arrangement avoids race conditions and improves concurrency.
  </para>
 </sect1>

 <sect1 id="catalog-pg-constraint">
  <title><structname>pg_constraint</structname></title>

  <indexterm zone="catalog-pg-constraint">
   <primary>pg_constraint</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_constraint</structname> stores check, primary
   key, unique, foreign key, and exclusion constraints on tables.
   (Column constraints are not treated specially.  Every column constraint is
   equivalent to some table constraint.)
   Not-null constraints are represented in the <structname>pg_attribute</>
   catalog, not here.
  </para>

  <para>
   User-defined constraint triggers (created with <command>CREATE CONSTRAINT
   TRIGGER</>) also give rise to an entry in this table.
  </para>

  <para>
   Check constraints on domains are stored here, too.
  </para>

  <table>
   <title><structname>pg_constraint</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>conname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Constraint name (not necessarily unique!)</entry>
     </row>

     <row>
      <entry><structfield>connamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this constraint
      </entry>
     </row>

     <row>
      <entry><structfield>contype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
        <literal>c</> = check constraint,
        <literal>f</> = foreign key constraint,
        <literal>p</> = primary key constraint,
        <literal>u</> = unique constraint,
        <literal>t</> = constraint trigger,
        <literal>x</> = exclusion constraint
      </entry>
     </row>

     <row>
      <entry><structfield>condeferrable</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Is the constraint deferrable?</entry>
     </row>

     <row>
      <entry><structfield>condeferred</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Is the constraint deferred by default?</entry>
     </row>

     <row>
      <entry><structfield>conrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this constraint is on; 0 if not a table constraint</entry>
     </row>

     <row>
      <entry><structfield>contypid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>The domain this constraint is on; 0 if not a domain constraint</entry>
     </row>

     <row>
      <entry><structfield>conindid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The index supporting this constraint, if it's a unique, primary
       key, foreign key, or exclusion constraint; else 0</entry>
     </row>

     <row>
      <entry><structfield>confrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>If a foreign key, the referenced table; else 0</entry>
     </row>

     <row>
      <entry><structfield>confupdtype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>Foreign key update action code:
            <literal>a</> = no action,
            <literal>r</> = restrict,
            <literal>c</> = cascade,
            <literal>n</> = set null,
            <literal>d</> = set default
          </entry>
     </row>

     <row>
      <entry><structfield>confdeltype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>Foreign key deletion action code:
            <literal>a</> = no action,
            <literal>r</> = restrict,
            <literal>c</> = cascade,
            <literal>n</> = set null,
            <literal>d</> = set default
          </entry>
     </row>

     <row>
      <entry><structfield>confmatchtype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>Foreign key match type:
            <literal>f</> = full,
            <literal>p</> = partial,
            <literal>u</> = simple (unspecified)
          </entry>
     </row>

     <row>
      <entry><structfield>conislocal</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This constraint is defined locally for the relation.  Note that a
       constraint can be locally defined and inherited simultaneously.
      </entry>
     </row>

     <row>
      <entry><structfield>coninhcount</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       The number of direct inheritance ancestors this constraint has.
       A constraint with
       a nonzero number of ancestors cannot be dropped nor renamed.
      </entry>
     </row>

     <row>
      <entry><structfield>conkey</structfield></entry>
      <entry><type>int2[]</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
      <entry>If a table constraint (including foreign keys, but not constraint
       triggers), list of the constrained columns</entry>
     </row>

     <row>
      <entry><structfield>confkey</structfield></entry>
      <entry><type>int2[]</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
      <entry>If a foreign key, list of the referenced columns</entry>
     </row>

     <row>
      <entry><structfield>conpfeqop</structfield></entry>
      <entry><type>oid[]</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
      <entry>If a foreign key, list of the equality operators for PK = FK comparisons</entry>
     </row>

     <row>
      <entry><structfield>conppeqop</structfield></entry>
      <entry><type>oid[]</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
      <entry>If a foreign key, list of the equality operators for PK = PK comparisons</entry>
     </row>

     <row>
      <entry><structfield>conffeqop</structfield></entry>
      <entry><type>oid[]</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
      <entry>If a foreign key, list of the equality operators for FK = FK comparisons</entry>
     </row>

     <row>
      <entry><structfield>conexclop</structfield></entry>
      <entry><type>oid[]</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
      <entry>If an exclusion constraint, list of the per-column exclusion operators</entry>
     </row>

     <row>
      <entry><structfield>conbin</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>If a check constraint, an internal representation of the expression</entry>
     </row>

     <row>
      <entry><structfield>consrc</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>If a check constraint, a human-readable representation of the expression</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   In the case of an exclusion constraint, <structfield>conkey</structfield>
   is only useful for constraint elements that are simple column references.
   For other cases, a zero appears in <structfield>conkey</structfield>
   and the associated index must be consulted to discover the expression
   that is constrained.  (<structfield>conkey</structfield> thus has the
   same contents as <structname>pg_index</>.<structfield>indkey</> for the
   index.)
  </para>

  <note>
   <para>
    <structfield>consrc</structfield> is not updated when referenced objects
    change; for example, it won't track renaming of columns.  Rather than
    relying on this field, it's best to use <function>pg_get_constraintdef()</>
    to extract the definition of a check constraint.
   </para>
  </note>

  <note>
   <para>
    <literal>pg_class.relchecks</literal> needs to agree with the
    number of check-constraint entries found in this table for each
    relation.  Also, <literal>pg_class.relhasexclusion</literal> must
    be true if there are any exclusion-constraint entries for the relation.
   </para>
  </note>

 </sect1>

 <sect1 id="catalog-pg-conversion">
  <title><structname>pg_conversion</structname></title>

  <indexterm zone="catalog-pg-conversion">
   <primary>pg_conversion</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_conversion</structname> describes the
   available encoding conversion procedures.  See
   <xref linkend="sql-createconversion">
   for more information.
  </para>

  <table>
   <title><structname>pg_conversion</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>conname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Conversion name (unique within a namespace)</entry>
     </row>

     <row>
      <entry><structfield>connamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this conversion
      </entry>
     </row>

     <row>
      <entry><structfield>conowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the conversion</entry>
     </row>

     <row>
      <entry><structfield>conforencoding</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>Source encoding ID</entry>
     </row>

     <row>
      <entry><structfield>contoencoding</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>Destination encoding ID</entry>
     </row>

     <row>
      <entry><structfield>conproc</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Conversion procedure</entry>
     </row>

     <row>
      <entry><structfield>condefault</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if this is the default conversion</entry>
     </row>

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

 </sect1>

 <sect1 id="catalog-pg-database">
  <title><structname>pg_database</structname></title>

  <indexterm zone="catalog-pg-database">
   <primary>pg_database</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_database</structname> stores information about
   the available databases.  Databases are created with the <xref
   linkend="sql-createdatabase"> command.
   Consult <xref linkend="managing-databases"> for details about the meaning
   of some of the parameters.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_database</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_database</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_database</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>datname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Database name</entry>
     </row>

     <row>
      <entry><structfield>datdba</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the database, usually the user who created it</entry>
     </row>

     <row>
      <entry><structfield>encoding</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>Character encoding for this database
          (<function>pg_encoding_to_char()</function> can translate
           this number to the encoding name)</entry>
     </row>

     <row>
      <entry><structfield>datcollate</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>LC_COLLATE for this database</entry>
     </row>

     <row>
      <entry><structfield>datctype</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>LC_CTYPE for this database</entry>
     </row>

     <row>
      <entry><structfield>datistemplate</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If true then this database can be used in the
       <literal>TEMPLATE</literal> clause of <command>CREATE
       DATABASE</command> to create a new database as a clone of
       this one
      </entry>
     </row>

     <row>
      <entry><structfield>datallowconn</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If false then no one can connect to this database.  This is
       used to protect the <literal>template0</> database from being altered.
      </entry>
     </row>

     <row>
      <entry><structfield>datconnlimit</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       Sets maximum number of concurrent connections that can be made
       to this database.  -1 means no limit.
      </entry>
     </row>

     <row>
      <entry><structfield>datlastsysoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry></entry>
      <entry>
       Last system OID in the database; useful
       particularly to <application>pg_dump</application>
      </entry>
     </row>

     <row>
      <entry><structfield>datfrozenxid</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       All transaction IDs before this one have been replaced with a permanent
       (<quote>frozen</>) transaction ID in this database.  This is used to
       track whether the database needs to be vacuumed in order to prevent
       transaction ID wraparound or to allow <literal>pg_clog</> to be shrunk.
       It is the minimum of the per-table
       <structname>pg_class</>.<structfield>relfrozenxid</> values.
      </entry>
     </row>

     <row>
      <entry><structfield>dattablespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
      <entry>
       The default tablespace for the database.
       Within this database, all tables for which
       <structname>pg_class</>.<structfield>reltablespace</> is zero
       will be stored in this tablespace; in particular, all the non-shared
       system catalogs will be there.
      </entry>
     </row>

     <row>
      <entry><structfield>datacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-db-role-setting">
  <title><structname>pg_db_role_setting</structname></title>

  <indexterm zone="catalog-pg-db-role-setting">
   <primary>pg_db_role_setting</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_db_role_setting</structname> records the default
   values that have been set for run-time configuration variables,
   for each role and database combination.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_db_role_setting</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_db_role_setting</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_db_role_setting</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>setdatabase</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
      <entry>The OID of the database the setting is applicable to, or zero if not database-specific</entry>
     </row>

     <row>
      <entry><structfield>setrole</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>The OID of the role the setting is applicable to, or zero if not role-specific</entry>
     </row>

     <row>
      <entry><structfield>setconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Defaults for run-time configuration variables</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-default-acl">
  <title><structname>pg_default_acl</structname></title>

  <indexterm zone="catalog-pg-default-acl">
   <primary>pg_default_acl</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_default_acl</> stores initial
   privileges to be assigned to newly created objects.
  </para>

  <table>
   <title><structname>pg_default_acl</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>defaclrole</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>The OID of the role associated with this entry</entry>
     </row>

     <row>
      <entry><structfield>defaclnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>The OID of the namespace associated with this entry,
       or 0 if none</entry>
     </row>

     <row>
      <entry><structfield>defaclobjtype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Type of object this entry is for:
       <literal>r</> = relation (table, view),
       <literal>S</> = sequence,
       <literal>f</> = function
      </entry>
     </row>

     <row>
      <entry><structfield>defaclacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges that this type of object should have on creation
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   A <structname>pg_default_acl</> entry shows the initial privileges to
   be assigned to an object belonging to the indicated user.  There are
   currently two types of entry: <quote>global</> entries with
   <structfield>defaclnamespace</> = 0, and <quote>per-schema</> entries
   that reference a particular schema.  If a global entry is present then
   it <emphasis>overrides</> the normal hard-wired default privileges
   for the object type.  A per-schema entry, if present, represents privileges
   to be <emphasis>added to</> the global or hard-wired default privileges.
  </para>

  <para>
   Note that when an ACL entry in another catalog is null, it is taken
   to represent the hard-wired default privileges for its object,
   <emphasis>not</> whatever might be in <structname>pg_default_acl</>
   at the moment.  <structname>pg_default_acl</> is only consulted during
   object creation.
  </para>

 </sect1>


 <sect1 id="catalog-pg-depend">
  <title><structname>pg_depend</structname></title>

  <indexterm zone="catalog-pg-depend">
   <primary>pg_depend</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_depend</structname> records the dependency
   relationships between database objects.  This information allows
   <command>DROP</> commands to find which other objects must be dropped
   by <command>DROP CASCADE</> or prevent dropping in the <command>DROP
   RESTRICT</> case.
  </para>

  <para>
   See also <link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link>,
   which performs a similar function for dependencies involving objects
   that are shared across a database cluster.
  </para>

  <table>
   <title><structname>pg_depend</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>classid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog the dependent object is in</entry>
     </row>

     <row>
      <entry><structfield>objid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the specific dependent object</entry>
     </row>

     <row>
      <entry><structfield>objsubid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       For a table column, this is the column number (the
       <structfield>objid</> and <structfield>classid</> refer to the
       table itself).  For all other object types, this column is
       zero.
      </entry>
     </row>

     <row>
      <entry><structfield>refclassid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog the referenced object is in</entry>
     </row>

     <row>
      <entry><structfield>refobjid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the specific referenced object</entry>
     </row>

     <row>
      <entry><structfield>refobjsubid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       For a table column, this is the column number (the
       <structfield>refobjid</> and <structfield>refclassid</> refer
       to the table itself).  For all other object types, this column
       is zero.
      </entry>
     </row>

     <row>
      <entry><structfield>deptype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       A code defining the specific semantics of this dependency relationship; see text
      </entry>
     </row>

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

  <para>
   In all cases, a <structname>pg_depend</structname> entry indicates that the
   referenced object cannot be dropped without also dropping the dependent
   object.  However, there are several subflavors identified by
   <structfield>deptype</>:

   <variablelist>
    <varlistentry>
     <term><symbol>DEPENDENCY_NORMAL</> (<literal>n</>)</term>
     <listitem>
      <para>
       A normal relationship between separately-created objects.  The
       dependent object can be dropped without affecting the
       referenced object.  The referenced object can only be dropped
       by specifying <literal>CASCADE</>, in which case the dependent
       object is dropped, too.  Example: a table column has a normal
       dependency on its data type.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>DEPENDENCY_AUTO</> (<literal>a</>)</term>
     <listitem>
      <para>
       The dependent object can be dropped separately from the
       referenced object, and should be automatically dropped
       (regardless of <literal>RESTRICT</> or <literal>CASCADE</>
       mode) if the referenced object is dropped.  Example: a named
       constraint on a table is made autodependent on the table, so
       that it will go away if the table is dropped.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>DEPENDENCY_INTERNAL</> (<literal>i</>)</term>
     <listitem>
      <para>
       The dependent object was created as part of creation of the
       referenced object, and is really just a part of its internal
       implementation.  A <command>DROP</> of the dependent object
       will be disallowed outright (we'll tell the user to issue a
       <command>DROP</> against the referenced object, instead).  A
       <command>DROP</> of the referenced object will be propagated
       through to drop the dependent object whether
       <command>CASCADE</> is specified or not.  Example: a trigger
       that's created to enforce a foreign-key constraint is made
       internally dependent on the constraint's
       <structname>pg_constraint</> entry.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>DEPENDENCY_PIN</> (<literal>p</>)</term>
     <listitem>
      <para>
       There is no dependent object; this type of entry is a signal
       that the system itself depends on the referenced object, and so
       that object must never be deleted.  Entries of this type are
       created only by <command>initdb</command>.  The columns for the
       dependent object contain zeroes.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>

   Other dependency flavors might be needed in future.
  </para>

 </sect1>


 <sect1 id="catalog-pg-description">
  <title><structname>pg_description</structname></title>

  <indexterm zone="catalog-pg-description">
   <primary>pg_description</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_description</> stores optional descriptions
   (comments) for each database object.  Descriptions can be manipulated
   with the <xref linkend="sql-comment"> command and viewed with
   <application>psql</application>'s <literal>\d</literal> commands.
   Descriptions of many built-in system objects are provided in the initial
   contents of <structname>pg_description</structname>.
  </para>

  <para>
   See also <link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>,
   which performs a similar function for descriptions involving objects that
   are shared across a database cluster.
  </para>

  <table>
   <title><structname>pg_description</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>objoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the object this description pertains to</entry>
     </row>

     <row>
      <entry><structfield>classoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog this object appears in</entry>
     </row>

     <row>
      <entry><structfield>objsubid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       For a comment on a table column, this is the column number (the
       <structfield>objoid</> and <structfield>classoid</> refer to
       the table itself).  For all other object types, this column is
       zero.
      </entry>
     </row>

     <row>
      <entry><structfield>description</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Arbitrary text that serves as the description of this object</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-enum">
  <title><structname>pg_enum</structname></title>

  <indexterm zone="catalog-pg-enum">
   <primary>pg_enum</primary>
  </indexterm>

  <para>
   The <structname>pg_enum</structname> catalog contains entries
   matching enum types to their associated values and labels. The
   internal representation of a given enum value is actually the OID
   of its associated row in <structname>pg_enum</structname>.  The
   OIDs for a particular enum type are guaranteed to be ordered in
   the way the type should sort, but there is no guarantee about the
   ordering of OIDs of unrelated enum types.
  </para>

  <table>
   <title><structname>pg_enum</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>enumtypid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>The OID of the <structname>pg_type</> entry owning this enum value</entry>
     </row>

     <row>
      <entry><structfield>enumlabel</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>The textual label for this enum value</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-foreign-data-wrapper">
  <title><structname>pg_foreign_data_wrapper</structname></title>

  <indexterm zone="catalog-pg-foreign-data-wrapper">
   <primary>pg_foreign_data_wrapper</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_foreign_data_wrapper</structname> stores
   foreign-data wrapper definitions.  A foreign-data wrapper is the
   mechanism by which external data, residing on foreign servers, is
   accessed.
  </para>

  <table>
   <title><structname>pg_foreign_data_wrapper</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>fdwname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the foreign-data wrapper</entry>
     </row>

     <row>
      <entry><structfield>fdwowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the foreign-data wrapper</entry>
     </row>

     <row>
      <entry><structfield>fdwvalidator</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>
       References a validator function that is responsible for
       checking the validity of the generic options given to the
       foreign-data wrapper, as well as to foreign servers and user
       mappings using the foreign-data wrapper.  Zero if no validator
       is provided.
      </entry>
     </row>

     <row>
      <entry><structfield>fdwacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>

     <row>
      <entry><structfield>fdwoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       Foreign-data wrapper specific options, as <quote>keyword=value</> strings
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-foreign-server">
  <title><structname>pg_foreign_server</structname></title>

  <indexterm zone="catalog-pg-foreign-server">
   <primary>pg_foreign_server</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_foreign_server</structname> stores
   foreign server definitions.  A foreign server describes the
   connection to a remote server, managing external data.  Foreign
   servers are accessed via foreign-data wrappers.
  </para>

  <table>
   <title><structname>pg_foreign_server</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>srvname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the foreign server</entry>
     </row>

     <row>
      <entry><structfield>srvowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the foreign server</entry>
     </row>

     <row>
      <entry><structfield>srvfdw</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link>.oid</literal></entry>
      <entry>The OID of the foreign-data wrapper of this foreign server</entry>
     </row>

     <row>
      <entry><structfield>srvtype</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Type of the server (optional)</entry>
     </row>

     <row>
      <entry><structfield>srvversion</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Version of the server (optional)</entry>
     </row>

     <row>
      <entry><structfield>srvacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>

     <row>
      <entry><structfield>srvoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       Foreign server specific options, as <quote>keyword=value</> strings
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-index">
  <title><structname>pg_index</structname></title>

  <indexterm zone="catalog-pg-index">
   <primary>pg_index</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_index</structname> contains part of the information
   about indexes.  The rest is mostly in
   <structname>pg_class</structname>.
  </para>

  <table>
   <title><structname>pg_index</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>indexrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the <structname>pg_class</> entry for this index</entry>
     </row>

     <row>
      <entry><structfield>indrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the <structname>pg_class</> entry for the table this index is for</entry>
     </row>

     <row>
      <entry><structfield>indnatts</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>The number of columns in the index (duplicates
      <literal>pg_class.relnatts</literal>)</entry>
     </row>

     <row>
      <entry><structfield>indisunique</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, this is a unique index</entry>
     </row>

     <row>
      <entry><structfield>indisprimary</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, this index represents the primary key of the table
      (<structfield>indisunique</> should always be true when this is true)</entry>
     </row>

     <row>
      <entry><structfield>indimmediate</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, the uniqueness check is enforced immediately on insertion
      (<structfield>indisunique</> should always be true when this is true)</entry>
     </row>

     <row>
      <entry><structfield>indisclustered</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, the table was last clustered on this index</entry>
     </row>

     <row>
      <entry><structfield>indisvalid</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If true, the index is currently valid for queries.  False means the
       index is possibly incomplete: it must still be modified by
       <command>INSERT</>/<command>UPDATE</> operations, but it cannot safely
       be used for queries. If it is unique, the uniqueness property is not
       true either.
      </entry>
     </row>

     <row>
      <entry><structfield>indcheckxmin</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If true, queries must not use the index until the <structfield>xmin</>
       of this <structname>pg_index</> row is below their <symbol>TransactionXmin</symbol>
       event horizon, because the table may contain broken HOT chains with
       incompatible rows that they can see
      </entry>
     </row>

     <row>
      <entry><structfield>indisready</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If true, the index is currently ready for inserts.  False means the
       index must be ignored by <command>INSERT</>/<command>UPDATE</>
       operations.
      </entry>
     </row>

     <row>
      <entry><structfield>indkey</structfield></entry>
      <entry><type>int2vector</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
      <entry>
       This is an array of <structfield>indnatts</structfield> values that
       indicate which table columns this index indexes.  For example a value
       of <literal>1 3</literal> would mean that the first and the third table
       columns make up the index key.  A zero in this array indicates that the
       corresponding index attribute is an expression over the table columns,
       rather than a simple column reference.
      </entry>
     </row>

     <row>
      <entry><structfield>indclass</structfield></entry>
      <entry><type>oidvector</type></entry>
      <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
      <entry>
       For each column in the index key, this contains the OID of
       the operator class to use.  See
       <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
      </entry>
     </row>

     <row>
      <entry><structfield>indoption</structfield></entry>
      <entry><type>int2vector</type></entry>
      <entry></entry>
      <entry>
       This is an array of <structfield>indnatts</structfield> values that
       store per-column flag bits.  The meaning of the bits is defined by
       the index's access method.
      </entry>
     </row>

     <row>
      <entry><structfield>indexprs</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>
       Expression trees (in <function>nodeToString()</function>
       representation) for index attributes that are not simple column
       references.  This is a list with one element for each zero
       entry in <structfield>indkey</>.  Null if all index attributes
       are simple references.
      </entry>
     </row>

     <row>
      <entry><structfield>indpred</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>
       Expression tree (in <function>nodeToString()</function>
       representation) for partial index predicate.  Null if not a
       partial index.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-inherits">
  <title><structname>pg_inherits</structname></title>

  <indexterm zone="catalog-pg-inherits">
   <primary>pg_inherits</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_inherits</> records information about
   table inheritance hierarchies.  There is one entry for each direct
   child table in the database.  (Indirect inheritance can be determined
   by following chains of entries.)
  </para>

  <table>
   <title><structname>pg_inherits</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>inhrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       The OID of the child table
      </entry>
     </row>

     <row>
      <entry><structfield>inhparent</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       The OID of the parent table
      </entry>
     </row>

     <row>
      <entry><structfield>inhseqno</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       If there is more than one direct parent for a child table (multiple
       inheritance), this number tells the order in which the
       inherited columns are to be arranged.  The count starts at 1.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-language">
  <title><structname>pg_language</structname></title>

  <indexterm zone="catalog-pg-language">
   <primary>pg_language</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_language</structname> registers
   languages in which you can write functions or stored procedures.
   See <xref linkend="sql-createlanguage">
   and <xref linkend="xplang"> for more information about language handlers.
  </para>

  <table>
   <title><structname>pg_language</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>lanname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the language</entry>
     </row>

     <row>
      <entry><structfield>lanowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the language</entry>
     </row>

     <row>
      <entry><structfield>lanispl</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       This is false for internal languages (such as
       <acronym>SQL</acronym>) and true for user-defined languages.
       Currently, <application>pg_dump</application> still uses this
       to determine which languages need to be dumped, but this might be
       replaced by a different mechanism in the future.
      </entry>
     </row>

     <row>
      <entry><structfield>lanpltrusted</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if this is a trusted language, which means that it is believed
       not to grant access to anything outside the normal SQL execution
       environment.  Only superusers can create functions in untrusted
       languages.
      </entry>
     </row>

     <row>
      <entry><structfield>lanplcallfoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>
       For noninternal languages this references the language
       handler, which is a special function that is responsible for
       executing all functions that are written in the particular
       language
      </entry>
     </row>

     <row>
      <entry><structfield>laninline</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>
       This references a function that is responsible for executing
       <quote>inline</> anonymous code blocks
       (<xref linkend="sql-do"> blocks).
       Zero if inline blocks are not supported.
      </entry>
     </row>

     <row>
      <entry><structfield>lanvalidator</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>
       This references a language validator function that is responsible
       for checking the syntax and validity of new functions when they
       are created.  Zero if no validator is provided.
      </entry>
     </row>

     <row>
      <entry><structfield>lanacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-largeobject">
  <title><structname>pg_largeobject</structname></title>

  <indexterm zone="catalog-pg-largeobject">
   <primary>pg_largeobject</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_largeobject</structname> holds the data making up
   <quote>large objects</quote>.  A large object is identified by an OID
   assigned when it is created.  Each large object is broken into
   segments or <quote>pages</> small enough to be conveniently stored as rows
   in <structname>pg_largeobject</structname>.
   The amount of data per page is defined to be <symbol>LOBLKSIZE</> (which is currently
   <literal>BLCKSZ/4</>, or typically 2 kB).
  </para>

  <para>
   Prior to <productname>PostgreSQL</> 9.0, there was no permission structure
   associated with large objects.  As a result,
   <structname>pg_largeobject</structname> was publicly readable and could be
   used to obtain the OIDs (and contents) of all large objects in the system.
   This is no longer the case; use
   <link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</></link>
   to obtain a list of large object OIDs.
  </para>

  <table>
   <title><structname>pg_largeobject</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>loid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link>.oid</literal></entry>
      <entry>Identifier of the large object that includes this page</entry>
     </row>

     <row>
      <entry><structfield>pageno</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>Page number of this page within its large object
      (counting from zero)</entry>
     </row>

     <row>
      <entry><structfield>data</structfield></entry>
      <entry><type>bytea</type></entry>
      <entry></entry>
      <entry>
       Actual data stored in the large object.
       This will never be more than <symbol>LOBLKSIZE</> bytes and might be less.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Each row of <structname>pg_largeobject</structname> holds data
   for one page of a large object, beginning at
   byte offset (<literal>pageno * LOBLKSIZE</>) within the object.  The implementation
   allows sparse storage: pages might be missing, and might be shorter than
   <literal>LOBLKSIZE</> bytes even if they are not the last page of the object.
   Missing regions within a large object read as zeroes.
  </para>

 </sect1>

 <sect1 id="catalog-pg-largeobject-metadata">
  <title><structname>pg_largeobject_metadata</structname></title>

  <indexterm zone="catalog-pg-largeobject-metadata">
   <primary>pg_largeobject_metadata</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_largeobject_metadata</structname>
   holds metadata associated with large objects.  The actual large object
   data is stored in
   <link linkend="catalog-pg-largeobject"><structname>pg_largeobject</></link>.
  </para>

  <table>
   <title><structname>pg_largeobject_metadata</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>lomowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the large object</entry>
     </row>

     <row>
      <entry><structfield>lomacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>

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

 <sect1 id="catalog-pg-namespace">
  <title><structname>pg_namespace</structname></title>

  <indexterm zone="catalog-pg-namespace">
   <primary>pg_namespace</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_namespace</> stores namespaces.
   A namespace is the structure underlying SQL schemas: each namespace
   can have a separate collection of relations, types, etc. without name
   conflicts.
  </para>

  <table>
   <title><structname>pg_namespace</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>nspname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the namespace</entry>
     </row>

     <row>
      <entry><structfield>nspowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the namespace</entry>
     </row>

     <row>
      <entry><structfield>nspacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-opclass">
  <title><structname>pg_opclass</structname></title>

  <indexterm zone="catalog-pg-opclass">
   <primary>pg_opclass</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_opclass</structname> defines
   index access method operator classes.  Each operator class defines
   semantics for index columns of a particular data type and a particular
   index access method.  An operator class essentially specifies that a
   particular operator family is applicable to a particular indexable column
   data type.  The set of operators from the family that are actually usable
   with the indexed column are whichever ones accept the column's data type
   as their lefthand input.
  </para>

  <para>
   Operator classes are described at length in <xref linkend="xindex">.
  </para>

  <table>
   <title><structname>pg_opclass</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>opcmethod</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
      <entry>Index access method operator class is for</entry>
     </row>

     <row>
      <entry><structfield>opcname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of this operator class</entry>
     </row>

     <row>
      <entry><structfield>opcnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>Namespace of this operator class</entry>
     </row>

     <row>
      <entry><structfield>opcowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the operator class</entry>
     </row>

     <row>
      <entry><structfield>opcfamily</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
      <entry>Operator family containing the operator class</entry>
     </row>

     <row>
      <entry><structfield>opcintype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Data type that the operator class indexes</entry>
     </row>

     <row>
      <entry><structfield>opcdefault</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if this operator class is the default for <structfield>opcintype</></entry>
     </row>

     <row>
      <entry><structfield>opckeytype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Type of data stored in index, or zero if same as <structfield>opcintype</></entry>
     </row>

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

  <para>
   An operator class's <structfield>opcmethod</> must match the
   <structname>opfmethod</> of its containing operator family.
   Also, there must be no more than one <structname>pg_opclass</structname>
   row having <structname>opcdefault</> true for any given combination of
   <structname>opcmethod</> and <structname>opcintype</>.
  </para>

 </sect1>


 <sect1 id="catalog-pg-operator">
  <title><structname>pg_operator</structname></title>

  <indexterm zone="catalog-pg-operator">
   <primary>pg_operator</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_operator</> stores information about operators.
   See <xref linkend="sql-createoperator">
   and <xref linkend="xoper"> for more information.
  </para>

  <table>
   <title><structname>pg_operator</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>oprname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the operator</entry>
     </row>

     <row>
      <entry><structfield>oprnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this operator
      </entry>
     </row>

     <row>
      <entry><structfield>oprowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the operator</entry>
     </row>

     <row>
      <entry><structfield>oprkind</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       <literal>b</> = infix (<quote>both</quote>), <literal>l</> = prefix
       (<quote>left</quote>), <literal>r</> = postfix (<quote>right</quote>)
      </entry>
     </row>

     <row>
      <entry><structfield>oprcanmerge</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>This operator supports merge joins</entry>
     </row>

     <row>
      <entry><structfield>oprcanhash</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>This operator supports hash joins</entry>
     </row>

     <row>
      <entry><structfield>oprleft</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Type of the left operand</entry>
     </row>

     <row>
      <entry><structfield>oprright</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Type of the right operand</entry>
     </row>

     <row>
      <entry><structfield>oprresult</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Type of the result</entry>
     </row>

     <row>
      <entry><structfield>oprcom</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>Commutator of this operator, if any</entry>
     </row>

     <row>
      <entry><structfield>oprnegate</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>Negator of this operator, if any</entry>
     </row>

     <row>
      <entry><structfield>oprcode</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Function that implements this operator</entry>
     </row>

     <row>
      <entry><structfield>oprrest</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Restriction selectivity estimation function for this operator</entry>
     </row>

     <row>
      <entry><structfield>oprjoin</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Join selectivity estimation function for this operator</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Unused column contain zeroes. For example, <structfield>oprleft</structfield>
   is zero for a prefix operator.
  </para>

 </sect1>


 <sect1 id="catalog-pg-opfamily">
  <title><structname>pg_opfamily</structname></title>

  <indexterm zone="catalog-pg-opfamily">
   <primary>pg_opfamily</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_opfamily</structname> defines operator families.
   Each operator family is a collection of operators and associated
   support routines that implement the semantics specified for a particular
   index access method.  Furthermore, the operators in a family are all
   <quote>compatible</>, in a way that is specified by the access method.
   The operator family concept allows cross-data-type operators to be used
   with indexes and to be reasoned about using knowledge of access method
   semantics.
  </para>

  <para>
   Operator families are described at length in <xref linkend="xindex">.
  </para>

  <table>
   <title><structname>pg_opfamily</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>opfmethod</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
      <entry>Index access method operator family is for</entry>
     </row>

     <row>
      <entry><structfield>opfname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of this operator family</entry>
     </row>

     <row>
      <entry><structfield>opfnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>Namespace of this operator family</entry>
     </row>

     <row>
      <entry><structfield>opfowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the operator family</entry>
     </row>

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

  <para>
   The majority of the information defining an operator family is not in its
   <structname>pg_opfamily</structname> row, but in the associated rows in
   <link linkend="catalog-pg-amop"><structname>pg_amop</structname></link>,
   <link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link>,
   and
   <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.
  </para>

 </sect1>


 <sect1 id="catalog-pg-pltemplate">
  <title><structname>pg_pltemplate</structname></title>

  <indexterm zone="catalog-pg-pltemplate">
   <primary>pg_pltemplate</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_pltemplate</structname> stores
   <quote>template</> information for procedural languages.
   A template for a language allows the language to be created in a
   particular database by a simple <command>CREATE LANGUAGE</> command,
   with no need to specify implementation details.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_pltemplate</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_pltemplate</structname> per cluster, not
   one per database.  This allows the information to be accessible in
   each database as it is needed.
  </para>

  <table>
   <title><structname>pg_pltemplate</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>tmplname</structfield></entry>
      <entry><type>name</type></entry>
      <entry>Name of the language this template is for</entry>
     </row>

     <row>
      <entry><structfield>tmpltrusted</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>True if language is considered trusted</entry>
     </row>

     <row>
      <entry><structfield>tmpldbacreate</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>True if language may be created by a database owner</entry>
     </row>

     <row>
      <entry><structfield>tmplhandler</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Name of call handler function</entry>
     </row>

     <row>
      <entry><structfield>tmplinline</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Name of anonymous-block handler function, or null if none</entry>
     </row>

     <row>
      <entry><structfield>tmplvalidator</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Name of validator function, or null if none</entry>
     </row>

     <row>
      <entry><structfield>tmpllibrary</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Path of shared library that implements language</entry>
     </row>

     <row>
      <entry><structfield>tmplacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry>Access privileges for template (not yet used)</entry>
     </row>

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

  <para>
   There are not currently any commands that manipulate procedural language
   templates; to change the built-in information, a superuser must modify
   the table using ordinary <command>INSERT</command>, <command>DELETE</command>,
   or <command>UPDATE</command> commands.  It is likely that a future
   release of <productname>PostgreSQL</productname> will offer
   commands to change the entries in a cleaner fashion.
  </para>

  <para>
   When implemented, the <structfield>tmplacl</structfield> field will provide
   access control for the template itself (i.e., the right to create a
   language using it), not for the languages created from the template.
  </para>

 </sect1>


 <sect1 id="catalog-pg-proc">
  <title><structname>pg_proc</structname></title>

  <indexterm zone="catalog-pg-proc">
   <primary>pg_proc</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_proc</> stores information about functions (or procedures).
   See <xref linkend="sql-createfunction">
   and <xref linkend="xfunc"> for more information.
  </para>

  <para>
   The table contains data for aggregate functions as well as plain functions.
   If <structfield>proisagg</structfield> is true, there should be a matching
   row in <structfield>pg_aggregate</structfield>.
  </para>

  <table>
   <title><structname>pg_proc</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>proname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the function</entry>
     </row>

     <row>
      <entry><structfield>pronamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this function
      </entry>
     </row>

     <row>
      <entry><structfield>proowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the function</entry>
     </row>

     <row>
      <entry><structfield>prolang</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-language"><structname>pg_language</structname></link>.oid</literal></entry>
      <entry>Implementation language or call interface of this function</entry>
     </row>

     <row>
      <entry><structfield>procost</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>Estimated execution cost (in units of
       <xref linkend="guc-cpu-operator-cost">); if <structfield>proretset</>,
       this is cost per row returned</entry>
     </row>

     <row>
      <entry><structfield>prorows</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>Estimated number of result rows (zero if not <structfield>proretset</>)</entry>
     </row>

     <row>
      <entry><structfield>provariadic</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Data type of the variadic array parameter's elements,
       or zero if the function does not have a variadic parameter</entry>
     </row>

     <row>
      <entry><structfield>proisagg</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function is an aggregate function</entry>
     </row>

     <row>
      <entry><structfield>proiswindow</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function is a window function</entry>
     </row>

     <row>
      <entry><structfield>prosecdef</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function is a security definer (i.e., a <quote>setuid</>
      function)</entry>
     </row>

     <row>
      <entry><structfield>proisstrict</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       Function returns null if any call argument is null.  In that
       case the function won't actually be called at all.  Functions
       that are not <quote>strict</quote> must be prepared to handle
       null inputs.
      </entry>
     </row>

     <row>
      <entry><structfield>proretset</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function returns a set (i.e., multiple values of the specified
      data type)</entry>
     </row>

     <row>
      <entry><structfield>provolatile</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       <structfield>provolatile</structfield> tells whether the function's
       result depends only on its input arguments, or is affected by outside
       factors.
       It is <literal>i</literal> for <quote>immutable</> functions,
       which always deliver the same result for the same inputs.
       It is <literal>s</literal> for <quote>stable</> functions,
       whose results (for fixed inputs) do not change within a scan.
       It is <literal>v</literal> for <quote>volatile</> functions,
       whose results might change at any time.  (Use <literal>v</literal> also
       for functions with side-effects, so that calls to them cannot get
       optimized away.)
      </entry>
     </row>

     <row>
      <entry><structfield>pronargs</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Number of input arguments</entry>
     </row>

     <row>
      <entry><structfield>pronargdefaults</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Number of arguments that have defaults</entry>
     </row>

     <row>
      <entry><structfield>prorettype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>Data type of the return value</entry>
     </row>

     <row>
      <entry><structfield>proargtypes</structfield></entry>
      <entry><type>oidvector</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       An array with the data types of the function arguments.  This includes
       only input arguments (including <literal>INOUT</literal> and
       <literal>VARIADIC</> arguments), and thus represents
       the call signature of the function.
      </entry>
     </row>

     <row>
      <entry><structfield>proallargtypes</structfield></entry>
      <entry><type>oid[]</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       An array with the data types of the function arguments.  This includes
       all arguments (including <literal>OUT</literal> and
       <literal>INOUT</literal> arguments); however, if all the
       arguments are <literal>IN</literal> arguments, this field will be null.
       Note that subscripting is 1-based, whereas for historical reasons
       <structfield>proargtypes</> is subscripted from 0.
      </entry>
     </row>

     <row>
      <entry><structfield>proargmodes</structfield></entry>
      <entry><type>char[]</type></entry>
      <entry></entry>
      <entry>
        An array with the modes of the function arguments, encoded as
        <literal>i</literal> for <literal>IN</> arguments,
        <literal>o</literal> for <literal>OUT</> arguments,
        <literal>b</literal> for <literal>INOUT</> arguments,
        <literal>v</literal> for <literal>VARIADIC</> arguments,
        <literal>t</literal> for <literal>TABLE</> arguments.
        If all the arguments are <literal>IN</literal> arguments,
        this field will be null.
        Note that subscripts correspond to positions of
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
      </entry>
     </row>

     <row>
      <entry><structfield>proargnames</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
        An array with the names of the function arguments.
        Arguments without a name are set to empty strings in the array.
        If none of the arguments have a name, this field will be null.
        Note that subscripts correspond to positions of
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
      </entry>
     </row>

     <row>
      <entry><structfield>proargdefaults</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>
       Expression trees (in <function>nodeToString()</function> representation)
       for default values.  This is a list with
       <structfield>pronargdefaults</> elements, corresponding to the last
       <replaceable>N</> <emphasis>input</> arguments (i.e., the last
       <replaceable>N</> <structfield>proargtypes</> positions).
       If none of the arguments have defaults, this field will be null.
      </entry>
     </row>

     <row>
      <entry><structfield>prosrc</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       This tells the function handler how to invoke the function.  It
       might be the actual source code of the function for interpreted
       languages, a link symbol, a file name, or just about anything
       else, depending on the implementation language/call convention.
      </entry>
     </row>

     <row>
      <entry><structfield>probin</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Additional information about how to invoke the function.
       Again, the interpretation is language-specific.
      </entry>
     </row>

     <row>
      <entry><structfield>proconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Function's local settings for run-time configuration variables</entry>
     </row>

     <row>
      <entry><structfield>proacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   For compiled functions, both built-in and dynamically loaded,
   <structfield>prosrc</structfield> contains the function's C-language
   name (link symbol).  For all other currently-known language types,
   <structfield>prosrc</structfield> contains the function's source
   text.  <structfield>probin</structfield> is unused except for
   dynamically-loaded C functions, for which it gives the name of the
   shared library file containing the function.
  </para>

 </sect1>

 <sect1 id="catalog-pg-rewrite">
  <title><structname>pg_rewrite</structname></title>

  <indexterm zone="catalog-pg-rewrite">
   <primary>pg_rewrite</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_rewrite</structname> stores rewrite rules for tables and views.
  </para>

  <table>
   <title><structname>pg_rewrite</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>rulename</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Rule name</entry>
     </row>

     <row>
      <entry><structfield>ev_class</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this rule is for</entry>
     </row>

     <row>
      <entry><structfield>ev_attr</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>The column this rule is for (currently, always zero to
      indicate the whole table)</entry>
     </row>

     <row>
      <entry><structfield>ev_type</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Event type that the rule is for: 1 = <command>SELECT</>, 2 =
       <command>UPDATE</>, 3 = <command>INSERT</>, 4 =
       <command>DELETE</>
      </entry>
     </row>

     <row>
      <entry><structfield>ev_enabled</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Controls in which <xref linkend="guc-session-replication-role"> modes
       the rule fires.
       <literal>O</> = rule fires in <quote>origin</> and <quote>local</> modes,
       <literal>D</> = rule is disabled,
       <literal>R</> = rule fires in <quote>replica</> mode,
       <literal>A</> = rule fires always.
      </entry>
     </row>

     <row>
      <entry><structfield>is_instead</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if the rule is an <literal>INSTEAD</literal> rule</entry>
     </row>

     <row>
      <entry><structfield>ev_qual</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>
       Expression tree (in the form of a
       <function>nodeToString()</function> representation) for the
       rule's qualifying condition
      </entry>
     </row>

     <row>
      <entry><structfield>ev_action</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>
       Query tree (in the form of a
       <function>nodeToString()</function> representation) for the
       rule's action
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <note>
   <para>
    <literal>pg_class.relhasrules</literal>
    must be true if a table has any rules in this catalog.
   </para>
  </note>

 </sect1>


 <sect1 id="catalog-pg-shdepend">
  <title><structname>pg_shdepend</structname></title>

  <indexterm zone="catalog-pg-shdepend">
   <primary>pg_shdepend</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_shdepend</structname> records the
   dependency relationships between database objects and shared objects,
   such as roles.  This information allows
   <productname>PostgreSQL</productname> to ensure that those objects are
   unreferenced before attempting to delete them.
  </para>

  <para>
   See also <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>,
   which performs a similar function for dependencies involving objects
   within a single database.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_shdepend</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_shdepend</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_shdepend</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>dbid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
      <entry>The OID of the database the dependent object is in,
       or zero for a shared object</entry>
     </row>

     <row>
      <entry><structfield>classid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog the dependent object is in</entry>
     </row>

     <row>
      <entry><structfield>objid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the specific dependent object</entry>
     </row>

     <row>
      <entry><structfield>objsubid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>
       For a table column, this is the column number (the
       <structfield>objid</> and <structfield>classid</> refer to the
       table itself).  For all other object types, this column is zero.
      </entry>
     </row>

     <row>
      <entry><structfield>refclassid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog the referenced object is in
       (must be a shared catalog)</entry>
     </row>

     <row>
      <entry><structfield>refobjid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the specific referenced object</entry>
     </row>

     <row>
      <entry><structfield>deptype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       A code defining the specific semantics of this dependency relationship; see text
      </entry>
     </row>

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

  <para>
   In all cases, a <structname>pg_shdepend</structname> entry indicates that
   the referenced object cannot be dropped without also dropping the dependent
   object.  However, there are several subflavors identified by
   <structfield>deptype</>:

   <variablelist>
    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_OWNER</> (<literal>o</>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is the owner of the
       dependent object.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_ACL</> (<literal>a</>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is mentioned in the
       ACL (access control list, i.e., privileges list) of the
       dependent object.  (A <symbol>SHARED_DEPENDENCY_ACL</> entry is
       not made for the owner of the object, since the owner will have
       a <symbol>SHARED_DEPENDENCY_OWNER</> entry anyway.)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_PIN</> (<literal>p</>)</term>
     <listitem>
      <para>
       There is no dependent object; this type of entry is a signal
       that the system itself depends on the referenced object, and so
       that object must never be deleted.  Entries of this type are
       created only by <command>initdb</command>.  The columns for the
       dependent object contain zeroes.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>

   Other dependency flavors might be needed in future.  Note in particular
   that the current definition only supports roles as referenced objects.
  </para>

 </sect1>

 <sect1 id="catalog-pg-shdescription">
  <title><structname>pg_shdescription</structname></title>

  <indexterm zone="catalog-pg-shdescription">
   <primary>pg_shdescription</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_shdescription</structname> stores optional
   descriptions (comments) for shared database objects.  Descriptions can be
   manipulated with the <xref linkend="sql-comment"> command and viewed with
   <application>psql</application>'s <literal>\d</literal> commands.
  </para>

  <para>
   See also <link linkend="catalog-pg-description"><structname>pg_description</structname></link>,
   which performs a similar function for descriptions involving objects
   within a single database.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_shdescription</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_shdescription</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_shdescription</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>objoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>The OID of the object this description pertains to</entry>
     </row>

     <row>
      <entry><structfield>classoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The OID of the system catalog this object appears in</entry>
     </row>

     <row>
      <entry><structfield>description</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Arbitrary text that serves as the description of this object</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-statistic">
  <title><structname>pg_statistic</structname></title>

  <indexterm zone="catalog-pg-statistic">
   <primary>pg_statistic</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_statistic</structname> stores
   statistical data about the contents of the database.  Entries are
   created by <xref linkend="sql-analyze">
   and subsequently used by the query planner.  Note that all the
   statistical data is inherently approximate, even assuming that it
   is up-to-date.
  </para>

  <para>
   Normally there is one entry, with <structfield>stainherit</> =
   <literal>false</>, for each table column that has been analyzed.
   If the table has inheritance children, a second entry with
   <structfield>stainherit</> = <literal>true</> is also created.  This row
   represents the column's statistics over the inheritance tree, i.e.,
   statistics for the data you'd see with
   <literal>SELECT <replaceable>column</> FROM <replaceable>table</>*</literal>,
   whereas the <structfield>stainherit</> = <literal>false</> row represents
   the results of
   <literal>SELECT <replaceable>column</> FROM ONLY <replaceable>table</></literal>.
  </para>

  <para>
   <structname>pg_statistic</structname> also stores statistical data about
   the values of index expressions.  These are described as if they were
   actual data columns; in particular, <structfield>starelid</structfield>
   references the index.  No entry is made for an ordinary non-expression
   index column, however, since it would be redundant with the entry
   for the underlying table column.  Currently, entries for index expressions
   always have <structfield>stainherit</> = <literal>false</>.
  </para>

  <para>
   Since different kinds of statistics might be appropriate for different
   kinds of data, <structname>pg_statistic</structname> is designed not
   to assume very much about what sort of statistics it stores.  Only
   extremely general statistics (such as nullness) are given dedicated
   columns in <structname>pg_statistic</structname>.  Everything else
   is stored in <quote>slots</quote>, which are groups of associated columns
   whose content is identified by a code number in one of the slot's columns.
   For more information see
   <filename>src/include/catalog/pg_statistic.h</filename>.
  </para>

  <para>
   <structname>pg_statistic</structname> should not be readable by the
   public, since even statistical information about a table's contents
   might be considered sensitive.  (Example: minimum and maximum values
   of a salary column might be quite interesting.)
   <link linkend="view-pg-stats"><structname>pg_stats</structname></link>
   is a publicly readable view on
   <structname>pg_statistic</structname> that only exposes information
   about those tables that are readable by the current user.
  </para>

  <table>
   <title><structname>pg_statistic</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>starelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table or index that the described column belongs to</entry>
     </row>

     <row>
      <entry><structfield>staattnum</structfield></entry>
      <entry><type>int2</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
      <entry>The number of the described column</entry>
     </row>

     <row>
      <entry><structfield>stainherit</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, the stats include inheritance child columns, not just the
       values in the specified relation</entry>
     </row>

     <row>
      <entry><structfield>stanullfrac</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>The fraction of the column's entries that are null</entry>
     </row>

     <row>
      <entry><structfield>stawidth</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>The average stored width, in bytes, of nonnull entries</entry>
     </row>

     <row>
      <entry><structfield>stadistinct</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>The number of distinct nonnull data values in the column.
      A value greater than zero is the actual number of distinct values.
      A value less than zero is the negative of a multiplier for the number
      of rows in the table; for example, a column in which values appear about
      twice on the average could be represented by
      <structfield>stadistinct</> = -0.5.
      A zero value means the number of distinct values is unknown.
      </entry>
     </row>

     <row>
      <entry><structfield>stakind<replaceable>N</></structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       A code number indicating the kind of statistics stored in the
       <replaceable>N</>th <quote>slot</quote> of the
       <structname>pg_statistic</structname> row.
      </entry>
     </row>

     <row>
      <entry><structfield>staop<replaceable>N</></structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>
       An operator used to derive the statistics stored in the
       <replaceable>N</>th <quote>slot</quote>.  For example, a
       histogram slot would show the <literal>&lt;</literal> operator
       that defines the sort order of the data.
      </entry>
     </row>

     <row>
      <entry><structfield>stanumbers<replaceable>N</></structfield></entry>
      <entry><type>float4[]</type></entry>
      <entry></entry>
      <entry>
       Numerical statistics of the appropriate kind for the
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
       kind does not involve numerical values
      </entry>
     </row>

     <row>
      <entry><structfield>stavalues<replaceable>N</></structfield></entry>
      <entry><type>anyarray</type></entry>
      <entry></entry>
      <entry>
       Column data values of the appropriate kind for the
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
       kind does not store any data values.  Each array's element
       values are actually of the specific column's data type, so there
       is no way to define these columns' type more specifically than
       <type>anyarray</>.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-tablespace">
  <title><structname>pg_tablespace</structname></title>

  <indexterm zone="catalog-pg-tablespace">
   <primary>pg_tablespace</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_tablespace</structname> stores information
   about the available tablespaces.  Tables can be placed in particular
   tablespaces to aid administration of disk layout.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_tablespace</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_tablespace</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_tablespace</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>spcname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Tablespace name</entry>
     </row>

     <row>
      <entry><structfield>spcowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the tablespace, usually the user who created it</entry>
     </row>

     <row>
      <entry><structfield>spclocation</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Location (directory path) of the tablespace</entry>
     </row>

     <row>
      <entry><structfield>spcacl</structfield></entry>
      <entry><type>aclitem[]</type></entry>
      <entry></entry>
      <entry>
       Access privileges; see
       <xref linkend="sql-grant"> and
       <xref linkend="sql-revoke">
       for details
      </entry>
     </row>

     <row>
      <entry><structfield>spcoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       Tablespace-level options, as <quote>keyword=value</> strings
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-trigger">
  <title><structname>pg_trigger</structname></title>

  <indexterm zone="catalog-pg-trigger">
   <primary>pg_trigger</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_trigger</structname> stores triggers on tables.
   See <xref linkend="sql-createtrigger">
   for more information.
  </para>

  <table>
   <title><structname>pg_trigger</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>tgrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this trigger is on</entry>
     </row>

     <row>
      <entry><structfield>tgname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Trigger name (must be unique among triggers of same table)</entry>
     </row>

     <row>
      <entry><structfield>tgfoid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>The function to be called</entry>
     </row>

     <row>
      <entry><structfield>tgtype</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Bit mask identifying trigger conditions</entry>
     </row>

     <row>
      <entry><structfield>tgenabled</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Controls in which <xref linkend="guc-session-replication-role"> modes
       the trigger fires.
       <literal>O</> = trigger fires in <quote>origin</> and <quote>local</> modes,
       <literal>D</> = trigger is disabled,
       <literal>R</> = trigger fires in <quote>replica</> mode,
       <literal>A</> = trigger fires always.
      </entry>
     </row>

     <row>
      <entry><structfield>tgisinternal</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if trigger is internally generated (usually, to enforce
       the constraint identified by <structfield>tgconstraint</>)</entry>
     </row>

     <row>
      <entry><structfield>tgconstrrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table referenced by a referential integrity constraint</entry>
     </row>

     <row>
      <entry><structfield>tgconstrindid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The index supporting a unique, primary key, or referential integrity constraint</entry>
     </row>

     <row>
      <entry><structfield>tgconstraint</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.oid</literal></entry>
      <entry>The <structname>pg_constraint</> entry associated with the trigger, if any</entry>
     </row>

     <row>
      <entry><structfield>tgdeferrable</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if constraint trigger is deferrable</entry>
     </row>

     <row>
      <entry><structfield>tginitdeferred</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if constraint trigger is initially deferred</entry>
     </row>

     <row>
      <entry><structfield>tgnargs</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Number of argument strings passed to trigger function</entry>
     </row>

     <row>
      <entry><structfield>tgattr</structfield></entry>
      <entry><type>int2vector</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
      <entry>Column numbers, if trigger is column-specific; otherwise an
       empty array</entry>
     </row>

     <row>
      <entry><structfield>tgargs</structfield></entry>
      <entry><type>bytea</type></entry>
      <entry></entry>
      <entry>Argument strings to pass to trigger, each NULL-terminated</entry>
     </row>

     <row>
      <entry><structfield>tgqual</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry>Expression tree (in <function>nodeToString()</function>
       representation) for the trigger's <literal>WHEN</> condition, or null
       if none</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Currently, column-specific triggering is supported only for
   <literal>UPDATE</> events, and so <structfield>tgattr</> is relevant
   only for that event type.  <structfield>tgtype</structfield> might
   contain bits for other event types as well, but those are presumed
   to be table-wide regardless of what is in <structfield>tgattr</>.
  </para>

  <note>
   <para>
    When <structfield>tgconstraint</> is nonzero,
    <structfield>tgconstrrelid</>, <structfield>tgconstrindid</>,
    <structfield>tgdeferrable</>, and <structfield>tginitdeferred</> are
    largely redundant with the referenced <structname>pg_constraint</> entry.
    However, it is possible for a non-deferrable trigger to be associated
    with a deferrable constraint: foreign key constraints can have some
    deferrable and some non-deferrable triggers.
   </para>
  </note>

  <note>
   <para>
    <literal>pg_class.relhastriggers</literal>
    must be true if a table has any triggers in this catalog.
   </para>
  </note>

 </sect1>


 <sect1 id="catalog-pg-ts-config">
  <title><structname>pg_ts_config</structname></title>

  <indexterm zone="catalog-pg-ts-config">
   <primary>pg_ts_config</primary>
  </indexterm>

  <para>
   The <structname>pg_ts_config</structname> catalog contains entries
   representing text search configurations.  A configuration specifies
   a particular text search parser and a list of dictionaries to use
   for each of the parser's output token types.  The parser is shown
   in the <structname>pg_ts_config</structname> entry, but the
   token-to-dictionary mapping is defined by subsidiary entries in <link
   linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link>.
  </para>

  <para>
   <productname>PostgreSQL</productname>'s text search features are
   described at length in <xref linkend="textsearch">.
  </para>

  <table>
   <title><structname>pg_ts_config</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>cfgname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Text search configuration name</entry>
     </row>

     <row>
      <entry><structfield>cfgnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this configuration
      </entry>
     </row>

     <row>
      <entry><structfield>cfgowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the configuration</entry>
     </row>

     <row>
      <entry><structfield>cfgparser</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link>.oid</literal></entry>
      <entry>The OID of the text search parser for this configuration</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-ts-config-map">
  <title><structname>pg_ts_config_map</structname></title>

  <indexterm zone="catalog-pg-ts-config-map">
   <primary>pg_ts_config_map</primary>
  </indexterm>

  <para>
   The <structname>pg_ts_config_map</structname> catalog contains entries
   showing which text search dictionaries should be consulted, and in
   what order, for each output token type of each text search configuration's
   parser.
  </para>

  <para>
   <productname>PostgreSQL</productname>'s text search features are
   described at length in <xref linkend="textsearch">.
  </para>

  <table>
   <title><structname>pg_ts_config_map</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>mapcfg</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link>.oid</literal></entry>
      <entry>The OID of the <structname>pg_ts_config</> entry owning this map entry</entry>
     </row>

     <row>
      <entry><structfield>maptokentype</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>A token type emitted by the configuration's parser</entry>
     </row>

     <row>
      <entry><structfield>mapseqno</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Order in which to consult this entry (lower
       <structfield>mapseqno</>s first)</entry>
     </row>

     <row>
      <entry><structfield>mapdict</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link>.oid</literal></entry>
      <entry>The OID of the text search dictionary to consult</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-ts-dict">
  <title><structname>pg_ts_dict</structname></title>

  <indexterm zone="catalog-pg-ts-dict">
   <primary>pg_ts_dict</primary>
  </indexterm>

  <para>
   The <structname>pg_ts_dict</structname> catalog contains entries
   defining text search dictionaries.  A dictionary depends on a text
   search template, which specifies all the implementation functions
   needed; the dictionary itself provides values for the user-settable
   parameters supported by the template.  This division of labor allows
   dictionaries to be created by unprivileged users.  The parameters
   are specified by a text string <structfield>dictinitoption</>,
   whose format and meaning vary depending on the template.
  </para>

  <para>
   <productname>PostgreSQL</productname>'s text search features are
   described at length in <xref linkend="textsearch">.
  </para>

  <table>
   <title><structname>pg_ts_dict</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>dictname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Text search dictionary name</entry>
     </row>

     <row>
      <entry><structfield>dictnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this dictionary
      </entry>
     </row>

     <row>
      <entry><structfield>dictowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the dictionary</entry>
     </row>

     <row>
      <entry><structfield>dicttemplate</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link>.oid</literal></entry>
      <entry>The OID of the text search template for this dictionary</entry>
     </row>

     <row>
      <entry><structfield>dictinitoption</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Initialization option string for the template</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-ts-parser">
  <title><structname>pg_ts_parser</structname></title>

  <indexterm zone="catalog-pg-ts-parser">
   <primary>pg_ts_parser</primary>
  </indexterm>

  <para>
   The <structname>pg_ts_parser</structname> catalog contains entries
   defining text search parsers.  A parser is responsible for splitting
   input text into lexemes and assigning a token type to each lexeme.
   Since a parser must be implemented by C-language-level functions,
   creation of new parsers is restricted to database superusers.
  </para>

  <para>
   <productname>PostgreSQL</productname>'s text search features are
   described at length in <xref linkend="textsearch">.
  </para>

  <table>
   <title><structname>pg_ts_parser</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>prsname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Text search parser name</entry>
     </row>

     <row>
      <entry><structfield>prsnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this parser
      </entry>
     </row>

     <row>
      <entry><structfield>prsstart</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the parser's startup function</entry>
     </row>

     <row>
      <entry><structfield>prstoken</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the parser's next-token function</entry>
     </row>

     <row>
      <entry><structfield>prsend</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the parser's shutdown function</entry>
     </row>

     <row>
      <entry><structfield>prsheadline</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the parser's headline function</entry>
     </row>

     <row>
      <entry><structfield>prslextype</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the parser's lextype function</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-ts-template">
  <title><structname>pg_ts_template</structname></title>

  <indexterm zone="catalog-pg-ts-template">
   <primary>pg_ts_template</primary>
  </indexterm>

  <para>
   The <structname>pg_ts_template</structname> catalog contains entries
   defining text search templates.  A template is the implementation
   skeleton for a class of text search dictionaries.
   Since a template must be implemented by C-language-level functions,
   creation of new templates is restricted to database superusers.
  </para>

  <para>
   <productname>PostgreSQL</productname>'s text search features are
   described at length in <xref linkend="textsearch">.
  </para>

  <table>
   <title><structname>pg_ts_template</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>tmplname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Text search template name</entry>
     </row>

     <row>
      <entry><structfield>tmplnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this template
      </entry>
     </row>

     <row>
      <entry><structfield>tmplinit</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the template's initialization function</entry>
     </row>

     <row>
      <entry><structfield>tmpllexize</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>OID of the template's lexize function</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


 <sect1 id="catalog-pg-type">
  <title><structname>pg_type</structname></title>

  <indexterm zone="catalog-pg-type">
   <primary>pg_type</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_type</structname> stores information about data
   types.  Base types and enum types (scalar types) are created with
   <xref linkend="sql-createtype">, and
   domains with
   <xref linkend="sql-createdomain">.
   A composite type is automatically created for each table in the database, to
   represent the row structure of the table.  It is also possible to create
   composite types with <command>CREATE TYPE AS</command>.
  </para>

  <table>
   <title><structname>pg_type</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>typname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Data type name</entry>
     </row>

     <row>
      <entry><structfield>typnamespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
      <entry>
       The OID of the namespace that contains this type
      </entry>
     </row>

     <row>
      <entry><structfield>typowner</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>Owner of the type</entry>
     </row>

     <row>
      <entry><structfield>typlen</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>
       For a fixed-size type, <structfield>typlen</structfield> is the number
       of bytes in the internal representation of the type.  But for a
       variable-length type, <structfield>typlen</structfield> is negative.
       -1 indicates a <quote>varlena</> type (one that has a length word),
       -2 indicates a null-terminated C string.
      </entry>
     </row>

     <row>
      <entry><structfield>typbyval</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       <structfield>typbyval</structfield> determines whether internal
       routines pass a value of this type by value or by reference.
       <structfield>typbyval</structfield> had better be false if
       <structfield>typlen</structfield> is not 1, 2, or 4 (or 8 on machines
       where Datum is 8 bytes).
       Variable-length types are always passed by reference. Note that
       <structfield>typbyval</structfield> can be false even if the
       length would allow pass-by-value.
      </entry>
     </row>

     <row>
      <entry><structfield>typtype</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       <structfield>typtype</structfield> is
       <literal>b</literal> for a base type,
       <literal>c</literal> for a composite type (e.g., a table's row type),
       <literal>d</literal> for a domain,
       <literal>e</literal> for an enum type,
       or <literal>p</literal> for a pseudo-type.
       See also <structfield>typrelid</structfield> and
       <structfield>typbasetype</structfield>.
      </entry>
     </row>

     <row>
      <entry><structfield>typcategory</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       <structfield>typcategory</structfield> is an arbitrary classification
       of data types that is used by the parser to determine which implicit
       casts should be <quote>preferred</>.
       See <xref linkend="catalog-typcategory-table">.
      </entry>
     </row>

     <row>
      <entry><structfield>typispreferred</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if the type is a preferred cast target within its
       <structfield>typcategory</structfield>
      </entry>
     </row>

     <row>
      <entry><structfield>typisdefined</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       True if the type is defined, false if this is a placeholder
       entry for a not-yet-defined type.  When
       <structfield>typisdefined</structfield> is false, nothing
       except the type name, namespace, and OID can be relied on.
      </entry>
     </row>

     <row>
      <entry><structfield>typdelim</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>
       Character that separates two values of this type when parsing
       array input.  Note that the delimiter is associated with the array
       element data type, not the array data type.
      </entry>
     </row>

     <row>
      <entry><structfield>typrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       If this is a composite type (see
       <structfield>typtype</structfield>), then this column points to
       the <structname>pg_class</structname> entry that defines the
       corresponding table.  (For a free-standing composite type, the
       <structname>pg_class</structname> entry doesn't really represent
       a table, but it is needed anyway for the type's
       <structname>pg_attribute</structname> entries to link to.)
       Zero for non-composite types.
      </entry>
     </row>

     <row>
      <entry><structfield>typelem</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       If <structfield>typelem</structfield> is not 0 then it
       identifies another row in <structname>pg_type</structname>.
       The current type can then be subscripted like an array yielding
       values of type <structfield>typelem</structfield>.  A
       <quote>true</quote> array type is variable length
       (<structfield>typlen</structfield> = -1),
       but some fixed-length (<structfield>typlen</structfield> &gt; 0) types
       also have nonzero <structfield>typelem</structfield>, for example
       <type>name</type> and <type>point</type>.
       If a fixed-length type has a <structfield>typelem</structfield> then
       its internal representation must be some number of values of the
       <structfield>typelem</structfield> data type with no other data.
       Variable-length array types have a header defined by the array
       subroutines.
      </entry>
     </row>

     <row>
      <entry><structfield>typarray</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       If <structfield>typarray</structfield> is not 0 then it
       identifies another row in <structname>pg_type</structname>, which
       is the <quote>true</quote> array type having this type as element
      </entry>
     </row>

     <row>
      <entry><structfield>typinput</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Input conversion function (text format)</entry>
     </row>

     <row>
      <entry><structfield>typoutput</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Output conversion function (text format)</entry>
     </row>

     <row>
      <entry><structfield>typreceive</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Input conversion function (binary format), or 0 if none</entry>
     </row>

     <row>
      <entry><structfield>typsend</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Output conversion function (binary format), or 0 if none</entry>
     </row>

     <row>
      <entry><structfield>typmodin</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Type modifier input function, or 0 if type does not support modifiers</entry>
     </row>

     <row>
      <entry><structfield>typmodout</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Type modifier output function, or 0 to use the standard format</entry>
     </row>

     <row>
      <entry><structfield>typanalyze</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
      <entry>Custom <command>ANALYZE</command> function, or 0 to use the standard function</entry>
     </row>

     <row>
      <entry><structfield>typalign</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry><para>

       <structfield>typalign</structfield> is the alignment required
       when storing a value of this type.  It applies to storage on
       disk as well as most representations of the value inside
       <productname>PostgreSQL</>.
       When multiple values are stored consecutively, such
       as in the representation of a complete row on disk, padding is
       inserted before a datum of this type so that it begins on the
       specified boundary.  The alignment reference is the beginning
       of the first datum in the sequence.
      </para>

      <para>
       Possible values are:
       <itemizedlist>
        <listitem>
         <para><literal>c</> = <type>char</type> alignment, i.e., no alignment needed.</para>
        </listitem>
        <listitem>
         <para><literal>s</> = <type>short</type> alignment (2 bytes on most machines).</para>
        </listitem>
        <listitem>
         <para><literal>i</> = <type>int</type> alignment (4 bytes on most machines).</para>
        </listitem>
        <listitem>
         <para><literal>d</> = <type>double</type> alignment (8 bytes on many machines, but by no means all).</para>
        </listitem>
       </itemizedlist>
      </para><note>
       <para>
        For types used in system tables, it is critical that the size
        and alignment defined in <structname>pg_type</structname>
        agree with the way that the compiler will lay out the column in
        a structure representing a table row.
       </para>
      </note></entry>
     </row>

     <row>
      <entry><structfield>typstorage</structfield></entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typstorage</structfield> tells for varlena
       types (those with <structfield>typlen</structfield> = -1) if
       the type is prepared for toasting and what the default strategy
       for attributes of this type should be.
       Possible values are
       <itemizedlist>
        <listitem>
         <para><literal>p</>: Value must always be stored plain.</para>
        </listitem>
        <listitem>
         <para>
          <literal>e</>: Value can be stored in a <quote>secondary</quote>
          relation (if relation has one, see
          <literal>pg_class.reltoastrelid</literal>).
         </para>
        </listitem>
        <listitem>
         <para><literal>m</>: Value can be stored compressed inline.</para>
        </listitem>
        <listitem>
         <para><literal>x</>: Value can be stored compressed inline or stored in <quote>secondary</quote> storage.</para>
        </listitem>
       </itemizedlist>
       Note that <literal>m</> columns can also be moved out to secondary
       storage, but only as a last resort (<literal>e</> and <literal>x</> columns are
       moved first).
      </para></entry>
     </row>

     <row>
      <entry><structfield>typnotnull</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typnotnull</structfield> represents a not-null
       constraint on a type.  Used for domains only.
      </para></entry>
     </row>

     <row>
      <entry><structfield>typbasetype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry><para>
       If this is a domain (see <structfield>typtype</structfield>), then
       <structfield>typbasetype</structfield> identifies the type that this
       one is based on.  Zero if this type is not a domain.
      </para></entry>
     </row>

     <row>
      <entry><structfield>typtypmod</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry><para>
       Domains use <structfield>typtypmod</structfield> to record the <literal>typmod</>
       to be applied to their base type (-1 if base type does not use a
       <literal>typmod</>).  -1 if this type is not a domain.
      </para></entry>
     </row>

     <row>
      <entry><structfield>typndims</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typndims</structfield> is the number of array dimensions
       for a domain that is an array (that is, <structfield>typbasetype</> is
       an array type; the domain's <structfield>typelem</> will match the base
       type's <structfield>typelem</structfield>).
       Zero for types other than domains over array types.
       </para></entry>
     </row>

     <row>
      <entry><structfield>typdefaultbin</structfield></entry>
      <entry><type>pg_node_tree</type></entry>
      <entry></entry>
      <entry><para>
       If <structfield>typdefaultbin</> is not null, it is the
       <function>nodeToString()</function>
       representation of a default expression for the type.  This is
       only used for domains.
      </para></entry>
     </row>

     <row>
      <entry><structfield>typdefault</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typdefault</> is null if the type has no associated
       default value. If <structfield>typdefaultbin</> is not null,
       <structfield>typdefault</> must contain a human-readable version of the
       default expression represented by <structfield>typdefaultbin</>.  If
       <structfield>typdefaultbin</> is null and <structfield>typdefault</> is
       not, then <structfield>typdefault</> is the external representation of
       the type's default value, which can be fed to the type's input
       converter to produce a constant.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   <xref linkend="catalog-typcategory-table"> lists the system-defined values
   of <structfield>typcategory</>.  Any future additions to this list will
   also be upper-case ASCII letters.  All other ASCII characters are reserved
   for user-defined categories.
  </para>

  <table id="catalog-typcategory-table">
   <title><structfield>typcategory</> Codes</title>

   <tgroup cols="2">
    <thead>
     <row>
      <entry>Code</entry>
      <entry>Category</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>A</literal></entry>
      <entry>Array types</entry>
     </row>
     <row>
      <entry><literal>B</literal></entry>
      <entry>Boolean types</entry>
     </row>
     <row>
      <entry><literal>C</literal></entry>
      <entry>Composite types</entry>
     </row>
     <row>
      <entry><literal>D</literal></entry>
      <entry>Date/time types</entry>
     </row>
     <row>
      <entry><literal>E</literal></entry>
      <entry>Enum types</entry>
     </row>
     <row>
      <entry><literal>G</literal></entry>
      <entry>Geometric types</entry>
     </row>
     <row>
      <entry><literal>I</literal></entry>
      <entry>Network address types</entry>
     </row>
     <row>
      <entry><literal>N</literal></entry>
      <entry>Numeric types</entry>
     </row>
     <row>
      <entry><literal>P</literal></entry>
      <entry>Pseudo-types</entry>
     </row>
     <row>
      <entry><literal>S</literal></entry>
      <entry>String types</entry>
     </row>
     <row>
      <entry><literal>T</literal></entry>
      <entry>Timespan types</entry>
     </row>
     <row>
      <entry><literal>U</literal></entry>
      <entry>User-defined types</entry>
     </row>
     <row>
      <entry><literal>V</literal></entry>
      <entry>Bit-string types</entry>
     </row>
     <row>
      <entry><literal>X</literal></entry>
      <entry><type>unknown</> type</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-user-mapping">
  <title><structname>pg_user_mapping</structname></title>

  <indexterm zone="catalog-pg-user-mapping">
   <primary>pg_user_mapping</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_user_mapping</structname> stores
   the mappings from local user to remote.  Access to this catalog is
   restricted from normal users, use the view
   <link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link>
   instead.
  </para>

  <table>
   <title><structname>pg_user_mapping</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>umuser</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
     </row>

     <row>
      <entry><structfield>umserver</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
      <entry>
       The OID of the foreign server that contains this mapping
      </entry>
     </row>

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


 <sect1 id="views-overview">
  <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 the results of
   the statistics collector; they are described in <xref
   linkend="monitoring-stats-views-table">.
  </para>

  <para>
   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-cursors"><structname>pg_cursors</structname></link></entry>
      <entry>open cursors</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-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>currently held locks</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-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-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-stats"><structname>pg_stats</structname></link></entry>
      <entry>planner statistics</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-views"><structname>pg_views</structname></link></entry>
      <entry>views</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 <xref linkend="sql-declare">
      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</>, such as procedural languages.
     Therefore, the <structname>pg_cursors</> view might include cursors
     that have not been explicitly created by the user.
    </para>
   </note>
  </para>

  <table>
   <title><structname>pg_cursors</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>name</structfield></entry>
      <entry><type>text</type></entry>
      <entry>The name of the cursor</entry>
     </row>

     <row>
      <entry><structfield>statement</structfield></entry>
      <entry><type>text</type></entry>
      <entry>The verbatim query string submitted to declare this cursor</entry>
     </row>

     <row>
      <entry><structfield>is_holdable</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>
       <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
       </entry>
     </row>

     <row>
      <entry><structfield>is_binary</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>
       <literal>true</literal> if the cursor was declared
       <literal>BINARY</literal>; <literal>false</literal>
       otherwise
       </entry>
     </row>

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

     <row>
      <entry><structfield>creation_time</structfield></entry>
      <entry><type>timestamptz</type></entry>
      <entry>The time at which the cursor was declared</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

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

 </sect1>

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

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

  <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</>, which is an approximation to the set
   of roles that are being used as groups.
  </para>

  <table>
   <title><structname>pg_group</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>groname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
      <entry>Name of the group</entry>
     </row>

     <row>
      <entry><structfield>grosysid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of this group</entry>
     </row>

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

 </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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>schemaname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
      <entry>Name of schema containing table and index</entry>
     </row>
     <row>
      <entry><structfield>tablename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of table the index is for</entry>
     </row>
     <row>
      <entry><structfield>indexname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of index</entry>
     </row>
     <row>
      <entry><structfield>tablespace</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
      <entry>Name of tablespace containing index (null if default for database)</entry>
     </row>
     <row>
      <entry><structfield>indexdef</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Index definition (a reconstructed <command>CREATE INDEX</command>
      command)</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 open transactions 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 transaction.  Thus, the same
   lockable object might
   appear many times, if multiple transactions 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 <structname>pg_description</structname> or
   <structname>pg_depend</structname>).  Also, the right to extend a
   relation is represented as a separate lockable object.
  </para>

  <table>
   <title><structname>pg_locks</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>locktype</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Type of the lockable object:
       <literal>relation</>,
       <literal>extend</>,
       <literal>page</>,
       <literal>tuple</>,
       <literal>transactionid</>,
       <literal>virtualxid</>,
       <literal>object</>,
       <literal>userlock</>, or
       <literal>advisory</>
      </entry>
     </row>
     <row>
      <entry><structfield>database</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
      <entry>
       OID of the database in which the object exists, or
       zero if the object is a shared object, or
       null if the object is a transaction ID
      </entry>
     </row>
     <row>
      <entry><structfield>relation</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       OID of the relation, or null if the object is not
       a relation or part of a relation
      </entry>
     </row>
     <row>
      <entry><structfield>page</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>
       Page number within the relation, or null if the object
       is not a tuple or relation page
      </entry>
     </row>
     <row>
      <entry><structfield>tuple</structfield></entry>
      <entry><type>smallint</type></entry>
      <entry></entry>
      <entry>
       Tuple number within the page, or null if the object is not a tuple
      </entry>
     </row>
     <row>
      <entry><structfield>virtualxid</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Virtual ID of a transaction, or null if the object is not a
       virtual transaction ID
      </entry>
     </row>
     <row>
      <entry><structfield>transactionid</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       ID of a transaction, or null if the object is not a transaction ID
      </entry>
     </row>
     <row>
      <entry><structfield>classid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>
       OID of the system catalog containing the object, or null if the
       object is not a general database object
      </entry>
     </row>
     <row>
      <entry><structfield>objid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry>any OID column</entry>
      <entry>
       OID of the object within its system catalog, or null if the
       object is not a general database object.
       For advisory locks it is used to distinguish the two key
       spaces (<literal>1</> for an int8 key, <literal>2</> for two
       int4 keys).
      </entry>
     </row>
     <row>
      <entry><structfield>objsubid</structfield></entry>
      <entry><type>smallint</type></entry>
      <entry></entry>
      <entry>
       For a table column, this is the column number (the
       <structfield>classid</> and <structfield>objid</> refer to the
       table itself).  For all other object types, this column is
       zero.  Null if the object is not a general database object
      </entry>
     </row>
     <row>
      <entry><structfield>virtualtransaction</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Virtual ID of the transaction that is holding or awaiting this lock
      </entry>
     </row>
     <row>
      <entry><structfield>pid</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>
       Process ID of the server process holding or awaiting this
       lock.  Null if the lock is held by a prepared transaction.
      </entry>
     </row>
     <row>
      <entry><structfield>mode</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Name of the lock mode held or desired by this process (see <xref
      linkend="locking-tables">)</entry>
     </row>
     <row>
      <entry><structfield>granted</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry></entry>
      <entry>True if lock is held, false if lock is awaited</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

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

  <para>
   Every transaction holds an exclusive lock on its virtual transaction ID for
   its entire duration.  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 its permanent transaction ID
   until it ends.  When one transaction finds it necessary to wait specifically
   for another transaction, it does so by attempting to acquire share lock on
   the other transaction 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 transaction 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>
   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</> column, its low-order half
   in the <structfield>objid</> column, and <structfield>objsubid</> equal
   to 1.  Integer keys are displayed with the first key in the
   <structfield>classid</> column, the second key in the <structfield>objid</>
   column, and <structfield>objsubid</> 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</> column is meaningful for an advisory lock.
  </para>

  <para>
   When the <structname>pg_locks</structname> view is accessed, the
   internal lock 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 lock manager operations longer than necessary.  Nonetheless
   there could be some impact on database performance if this view is
   frequently accessed.
  </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 <structname>pg_class</>.<structfield>oid</> 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>procpid</structfield> column of the
   <structname>pg_stat_activity</structname> view to get more
   information on the session holding or waiting to hold each lock.
   Also, if you are using prepared transactions, the
   <structfield>transaction</> column can be joined to the
   <structfield>transaction</structfield> column of the
   <structname>pg_prepared_xacts</structname> 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.)
  </para>

 </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 <xref linkend="sql-deallocate"> command).
  </para>

  <table>
   <title><structname>pg_prepared_statements</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>name</structfield></entry>
      <entry><type>text</type></entry>
      <entry>
       The identifier of the prepared statement
      </entry>
     </row>
     <row>
      <entry><structfield>statement</structfield></entry>
      <entry><type>text</type></entry>
      <entry>
       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.
      </entry>
     </row>
     <row>
      <entry><structfield>prepare_time</structfield></entry>
      <entry><type>timestamptz</type></entry>
      <entry>
       The time at which the prepared statement was created
      </entry>
     </row>
     <row>
      <entry><structfield>parameter_types</structfield></entry>
      <entry><type>regtype[]</type></entry>
      <entry>
       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>.
      </entry>
     </row>
     <row>
      <entry><structfield>from_sql</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>
       <literal>true</literal> if the prepared statement was created
       via the <command>PREPARE</command> SQL statement;
       <literal>false</literal> if the statement was prepared via the
       frontend/backend protocol
      </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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>transaction</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       Numeric transaction identifier of the prepared transaction
      </entry>
     </row>
     <row>
      <entry><structfield>gid</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Global transaction identifier that was assigned to the transaction
      </entry>
     </row>
     <row>
      <entry><structfield>prepared</structfield></entry>
      <entry><type>timestamp with time zone</type></entry>
      <entry></entry>
      <entry>
       Time at which the transaction was prepared for commit
      </entry>
     </row>
     <row>
      <entry><structfield>owner</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
      <entry>
       Name of the user that executed the transaction
      </entry>
     </row>
     <row>
      <entry><structfield>database</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.datname</literal></entry>
      <entry>
       Name of the database in which the transaction was executed
      </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-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>

  <para>
   This view explicitly exposes the OID column of the underlying table,
   since that is needed to do joins to other catalogs.
  </para>

  <table>
   <title><structname>pg_roles</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>rolname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Role name</entry>
     </row>

     <row>
      <entry><structfield>rolsuper</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Role has superuser privileges</entry>
     </row>

     <row>
      <entry><structfield>rolinherit</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Role automatically inherits privileges of roles it is a
       member of</entry>
     </row>

     <row>
      <entry><structfield>rolcreaterole</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Role can create more roles</entry>
     </row>

     <row>
      <entry><structfield>rolcreatedb</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Role can create databases</entry>
     </row>

     <row>
      <entry><structfield>rolcatupdate</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       Role can update system catalogs directly.  (Even a superuser cannot do
       this unless this column is true.)
      </entry>
     </row>

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

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

     <row>
      <entry><structfield>rolpassword</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Not the password (always reads as <literal>********</>)</entry>
     </row>

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

     <row>
      <entry><structfield>oid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of role</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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>schemaname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
      <entry>Name of schema containing table</entry>
     </row>
     <row>
      <entry><structfield>tablename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of table the rule is for</entry>
     </row>
     <row>
      <entry><structfield>rulename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link>.rulename</literal></entry>
      <entry>Name of rule</entry>
     </row>
     <row>
      <entry><structfield>definition</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Rule definition (a reconstructed creation command)</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_rules</> view excludes the <literal>ON SELECT</> rules
   of views; those can be seen in <structname>pg_views</>.
  </para>

 </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 <xref linkend="sql-show">
   and <xref linkend="sql-set"> commands.
   It also provides access to some facts about each parameter that are
   not directly available from <command>SHOW</>, such as minimum and
   maximum values.
  </para>

  <table>
   <title><structname>pg_settings</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>name</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Run-time configuration parameter name</entry>
     </row>
     <row>
      <entry><structfield>setting</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Current value of the parameter</entry>
     </row>
     <row>
      <entry><structfield>unit</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Implicit unit of the parameter</entry>
     </row>
     <row>
      <entry><structfield>category</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Logical group of the parameter</entry>
     </row>
     <row>
      <entry><structfield>short_desc</structfield></entry>
      <entry><type>text</type></entry>
      <entry>A brief description of the parameter</entry>
     </row>
     <row>
      <entry><structfield>extra_desc</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Additional, more detailed, description of the parameter</entry>
     </row>
     <row>
      <entry><structfield>context</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Context required to set the parameter's value</entry>
     </row>
     <row>
      <entry><structfield>vartype</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Parameter type (<literal>bool</>, <literal>enum</>,
       <literal>integer</>, <literal>real</>, or <literal>string</>)
      </entry>
     </row>
     <row>
      <entry><structfield>source</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Source of the current parameter value</entry>
     </row>
     <row>
      <entry><structfield>min_val</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Minimum allowed value of the parameter (null for non-numeric
      values)</entry>
     </row>
     <row>
      <entry><structfield>max_val</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Maximum allowed value of the parameter (null for non-numeric
      values)</entry>
     </row>
     <row>
      <entry><structfield>enumvals</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry>Allowed values of an enum parameter (null for non-enum
      values)</entry>
     </row>
     <row>
      <entry><structfield>boot_val</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Parameter value assumed at server startup if the parameter is
      not otherwise set</entry>
     </row>
     <row>
      <entry><structfield>reset_val</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Value that <command>RESET</command> would reset the parameter to
      in the current session</entry>
     </row>
     <row>
      <entry><structfield>sourcefile</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Configuration file the current value was set in (null for
      values set from sources other than configuration files, or when
      examined by a non-superuser);
      helpful when using <literal>include</> directives in configuration files</entry>
     </row>
     <row>
      <entry><structfield>sourceline</structfield></entry>
      <entry><type>integer</type></entry>
      <entry>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 non-superuser)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The <structname>pg_settings</structname> 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 <xref linkend="sql-set"> 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>

 </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</> 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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>usename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
      <entry>User name</entry>
     </row>

     <row>
      <entry><structfield>usesysid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>ID of this user</entry>
     </row>

     <row>
      <entry><structfield>usecreatedb</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>User can create databases</entry>
     </row>

     <row>
      <entry><structfield>usesuper</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>User is a superuser</entry>
     </row>

     <row>
      <entry><structfield>usecatupd</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       User can update system catalogs.  (Even a superuser cannot do
       this unless this column is true.)
      </entry>
     </row>

     <row>
      <entry><structfield>passwd</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>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.</entry>
     </row>

     <row>
      <entry><structfield>valuntil</structfield></entry>
      <entry><type>abstime</type></entry>
      <entry></entry>
      <entry>Password expiry time (only used for password authentication)</entry>
     </row>

     <row>
      <entry><structfield>useconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Session defaults for run-time configuration variables</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </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
   <structname>pg_statistic</structname> 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 <structname>pg_statistic</structname>.
  </para>

  <table>
   <title><structname>pg_stats</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>schemaname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
      <entry>Name of schema containing table</entry>
     </row>

     <row>
      <entry><structfield>tablename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of table</entry>
     </row>

     <row>
      <entry><structfield>attname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attname</literal></entry>
      <entry>Name of the column described by this row</entry>
     </row>

     <row>
      <entry><structfield>inherited</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If true, this row includes inheritance child columns, not just the
       values in the specified table</entry>
     </row>

     <row>
      <entry><structfield>null_frac</structfield></entry>
      <entry><type>real</type></entry>
      <entry></entry>
      <entry>Fraction of column entries that are null</entry>
     </row>

     <row>
      <entry><structfield>avg_width</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Average width in bytes of column's entries</entry>
     </row>

     <row>
      <entry><structfield>n_distinct</structfield></entry>
      <entry><type>real</type></entry>
      <entry></entry>
      <entry>
       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</> 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.
      </entry>
     </row>

     <row>
      <entry><structfield>most_common_vals</structfield></entry>
      <entry><type>anyarray</type></entry>
      <entry></entry>
      <entry>
       A list of the most common values in the column. (Null if
       no values seem to be more common than any others.)
       For some data types such as <type>tsvector</>, this is a list of
       the most common element values rather than values of the type itself.
      </entry>
     </row>

     <row>
      <entry><structfield>most_common_freqs</structfield></entry>
      <entry><type>real[]</type></entry>
      <entry></entry>
      <entry>
       A list of the frequencies of the most common values or elements,
       i.e., number of occurrences of each divided by total number of rows.
       (Null when <structfield>most_common_vals</structfield> is.)
       For some data types such as <type>tsvector</>, it can also store some
       additional information, making it longer than the
       <structfield>most_common_vals</> array.
      </entry>
     </row>

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

     <row>
      <entry><structfield>correlation</structfield></entry>
      <entry><type>real</type></entry>
      <entry></entry>
      <entry>
       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;</> operator.)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the <structfield>most_common_vals</>
   and <structfield>histogram_bounds</> arrays can be set on a
   column-by-column basis using the <command>ALTER TABLE SET STATISTICS</>
   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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>schemaname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
      <entry>Name of schema containing table</entry>
     </row>
     <row>
      <entry><structfield>tablename</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of table</entry>
     </row>
     <row>
      <entry><structfield>tableowner</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
      <entry>Name of table's owner</entry>
     </row>
     <row>
      <entry><structfield>tablespace</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
      <entry>Name of tablespace containing table (null if default for database)</entry>
     </row>
     <row>
      <entry><structfield>hasindexes</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasindex</literal></entry>
      <entry>True if table has (or recently had) any indexes</entry>
     </row>
     <row>
      <entry><structfield>hasrules</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasrules</literal></entry>
      <entry>True if table has (or once had) rules</entry>
     </row>
     <row>
      <entry><structfield>hastriggers</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhastriggers</literal></entry>
      <entry>True if table has (or once had) triggers</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</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>abbrev</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Time zone abbreviation</entry>
     </row>
     <row>
      <entry><structfield>utc_offset</structfield></entry>
      <entry><type>interval</type></entry>
      <entry>Offset from UTC (positive means east of Greenwich)</entry>
     </row>
     <row>
      <entry><structfield>is_dst</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>True if this is a daylight-savings abbreviation</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </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</>,
   along with their associated abbreviations, UTC offsets,
   and daylight-savings status.
   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</>.
  </para>

  <table>
   <title><structname>pg_timezone_names</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>name</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Time zone name</entry>
     </row>
     <row>
      <entry><structfield>abbrev</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Time zone abbreviation</entry>
     </row>
     <row>
      <entry><structfield>utc_offset</structfield></entry>
      <entry><type>interval</type></entry>
      <entry>Offset from UTC (positive means east of Greenwich)</entry>
     </row>
     <row>
      <entry><structfield>is_dst</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>True if currently observing daylight savings</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</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>usename</structfield></entry>
      <entry><type>name</type></entry>
      <entry>User name</entry>
     </row>

     <row>
      <entry><structfield>usesysid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry>User ID (arbitrary number used to reference this user)</entry>
     </row>

     <row>
      <entry><structfield>usecreatedb</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>User can create databases</entry>
     </row>

     <row>
      <entry><structfield>usesuper</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>User is a superuser</entry>
     </row>

     <row>
      <entry><structfield>usecatupd</structfield></entry>
      <entry><type>bool</type></entry>
      <entry>
       User can update system catalogs.  (Even a superuser cannot do
       this unless this column is true.)
      </entry>
     </row>

     <row>
      <entry><structfield>passwd</structfield></entry>
      <entry><type>text</type></entry>
      <entry>Not the password (always reads as <literal>********</>)</entry>
     </row>

     <row>
      <entry><structfield>valuntil</structfield></entry>
      <entry><type>abstime</type></entry>
      <entry>Password expiry time (only used for password authentication)</entry>
     </row>

     <row>
      <entry><structfield>useconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry>Session defaults for run-time configuration variables</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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>umid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>.oid</literal></entry>
      <entry>OID of the user mapping</entry>
     </row>

     <row>
      <entry><structfield>srvid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
      <entry>
       The OID of the foreign server that contains this mapping
      </entry>
     </row>

     <row>
      <entry><structfield>srvname</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>
       Name of the foreign server
      </entry>
     </row>

     <row>
      <entry><structfield>umuser</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
     </row>

     <row>
      <entry><structfield>usename</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the local user to be mapped</entry>
     </row>

     <row>
      <entry><structfield>umoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       User mapping specific options, as <quote>keyword=value</>
       strings, if the current user is the owner of the foreign
       server, else null
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </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</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry><structfield>schemaname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
      <entry>Name of schema containing view</entry>
     </row>
     <row>
      <entry><structfield>viewname</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
      <entry>Name of view</entry>
     </row>
     <row>
      <entry><structfield>viewowner</structfield></entry>
      <entry><type>name</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
      <entry>Name of view's owner</entry>
     </row>
     <row>
      <entry><structfield>definition</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>View definition (a reconstructed <command>SELECT</command> query)</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

</chapter>
@


2.230
log
@Elaborate on what gets stored in pg_authid.rolpasswd.

Also, add cross-reference from pg_shadow.passwd to pg_authid.rolpasswd and
fix a bit of markup I muffed in my previous commit.

Per discussion with Josh Kupershmidt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.229 2010/09/13 01:23:35 rhaas Exp $ -->
d117 5
a211 5
      <entry><link linkend="catalog-pg-db-role-setting"><structname>pg_db_role_setting</structname></link></entry>
      <entry>per-role and per-database settings</entry>
     </row>

     <row>
d2216 60
a4230 59
 <sect1 id="catalog-pg-db-role-setting">
  <title><structname>pg_db_role_setting</structname></title>

  <indexterm zone="catalog-pg-db-role-setting">
   <primary>pg_db_role_setting</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_db_role_setting</structname> records the default
   values that have been set for run-time configuration variables,
   for each role and database combination.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_db_role_setting</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_db_role_setting</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_db_role_setting</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>setdatabase</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
      <entry>The OID of the database the setting is applicable to, or zero if not database-specific</entry>
     </row>

     <row>
      <entry><structfield>setrole</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>The OID of the role the setting is applicable to, or zero if not role-specific</entry>
     </row>

     <row>
      <entry><structfield>setconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Defaults for run-time configuration variables</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

@


2.229
log
@Link from pg_shadow docs to pg_authid docs.

Per discussion with Josh Kupershmidt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.228 2010/09/03 01:34:54 tgl Exp $ -->
d1182 8
a1189 1
      <entry>Password (possibly encrypted); null if none</entry>
d6948 1
a6948 1
   <link linkend="catalog-pg-authid">pg_authid</link>.
d7015 3
a7017 1
      <entry>Password (possibly encrypted)</entry>
@


2.228
log
@Install a data-type-based solution for protecting pg_get_expr().

Since the code underlying pg_get_expr() is not secure against malformed
input, and can't practically be made so, we need to prevent miscreants
from feeding arbitrary data to it.  We can do this securely by declaring
pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
system catalog columns that hold nodeToString output to be of that type.
There is no way at SQL level to create a non-null value of type pg_node_tree.
Since the backend-internal operations that fill those catalog columns
operate below the SQL level, they are oblivious to the datatype relabeling
and don't need any changes.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.227 2010/08/25 18:18:41 petere Exp $ -->
d6940 2
a6941 1
   <structfield>rolcanlogin</>.
@


2.227
log
@Add missing description of reloftype field
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.226 2010/08/17 04:37:20 petere Exp $ -->
d800 1
a800 1
      <entry><type>text</type></entry>
d1920 1
a1920 1
      <entry><type>text</type></entry>
d2918 1
a2918 1
      <entry><type>text</type></entry>
d2931 1
a2931 1
      <entry><type>text</type></entry>
d3983 1
a3983 1
      <entry><type>text</type></entry>
d4132 1
a4132 1
      <entry><type>text</type></entry>
d4143 1
a4143 1
      <entry><type>text</type></entry>
d4842 1
a4842 1
      <entry><type>text</type></entry>
d5625 1
a5625 1
      <entry><type>text</type></entry>
d5628 2
a5629 1
       If <structfield>typdefaultbin</> is not null, it is the <function>nodeToString()</function>
d5646 1
a5646 1
       the type's default value, which might be fed to the type's input
@


2.226
log
@Spell and markup checking
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225 2010/04/03 07:22:52 petere Exp $ -->
d1448 10
@


2.225
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.224 2010/03/25 14:44:33 alvherre Exp $ -->
d347 2
a348 2
       representation.  If this field is NULL, the transition state
       value starts out NULL
d464 1
a464 1
      <entry>Does the access method support IS NULL/NOT NULL searches?</entry>
d895 1
a895 1
       to collect, and the target number of histogram bins to create
d916 1
a916 1
       have (arbitrary) negative numbers
d927 1
a927 1
       so any nonzero value effectively means <quote>it's an array</>)
d951 1
a951 1
       The value will generally be -1 for types that do not need <structfield>atttypmod</>
d971 1
a971 1
       after column creation to control storage policy
d990 1
a990 1
       change this column to enable or disable the constraint
d1001 1
a1001 1
       catalog that actually defines the value
d1012 1
a1012 1
       ignored by the parser and so cannot be accessed via SQL
d1022 1
a1022 1
       be locally defined and inherited simultaneously
d1032 1
a1032 1
       nonzero number of ancestors cannot be dropped nor renamed
d1166 1
a1166 1
       session authorization identifier
d1175 1
a1175 1
       connections this role can make.  -1 means no limit
d1182 1
a1182 1
      <entry>Password (possibly encrypted); NULL if none</entry>
d1189 1
a1189 1
       NULL if no expiration</entry>
d1341 1
a1341 1
       other cases
d1352 1
a1352 1
       <literal>b</> means that the types are binary-coercible, thus no conversion is required
d1490 1
a1490 1
       <command>CREATE INDEX</command>
d1502 1
a1502 1
       <command>CREATE INDEX</command>
d1513 1
a1513 1
       secondary table
d1522 1
a1522 1
       For a TOAST table, the OID of its index.  0 if not a TOAST table
d1542 1
a1542 1
       are shared
d1552 1
a1552 1
       session can safely access its contents
d1576 1
a1576 1
       <literal>pg_attribute.attnum</literal>
d1655 1
a1655 1
       (<symbol>InvalidTransactionId</symbol>) if the relation is not a table
d1684 1
a1684 1
   Several of the boolean flags in <structname>pg_class</> are maintained
d1850 1
a1850 1
       constraint can be locally defined and inherited simultaneously
d1861 1
a1861 1
       a nonzero number of ancestors cannot be dropped nor renamed
d2131 1
a2131 1
       used to protect the <literal>template0</> database from being altered
d2141 1
a2141 1
       to this database.  -1 means no limit
d2165 1
a2165 1
       <structname>pg_class</>.<structfield>relfrozenxid</> values
d2178 1
a2178 1
       system catalogs will be there
d2276 1
a2276 1
   Note that when an ACL entry in another catalog is NULL, it is taken
d2343 1
a2343 1
       zero
d2369 1
a2369 1
       is zero
d2518 1
a2518 1
       zero
d2746 1
a2746 1
       Foreign server specific options, as <quote>keyword=value</> strings.
d2843 1
a2843 1
       true either
d2853 1
a2853 1
       of this <structname>pg_index</> row is below their TransactionXmin
d2866 1
a2866 1
       operations
d2880 1
a2880 1
       rather than a simple column reference
d2891 1
a2891 1
       <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details
d2902 1
a2902 1
       the index's access method
d2910 7
a2916 4
      <entry>Expression trees (in <function>nodeToString()</function> representation)
      for index attributes that are not simple column references.  This is a
      list with one element for each zero entry in <structfield>indkey</>.
      NULL if all index attributes are simple references</entry>
d2923 5
a2927 2
      <entry>Expression tree (in <function>nodeToString()</function> representation)
      for partial index predicate.  NULL if not a partial index</entry>
d2989 1
a2989 1
       inherited columns are to be arranged.  The count starts at 1
d3050 1
a3050 1
       replaced by a different mechanism in the future
d3062 1
a3062 1
       languages
d3086 1
a3086 1
       Zero if inline blocks are not supported
d3097 1
a3097 1
       are created.  Zero if no validator is provided
d3142 1
a3142 1
   <link linkend="catalog-pg-largeobject-metadata">pg_largeobject_metadata</link>
d3181 1
a3181 1
       This will never be more than <symbol>LOBLKSIZE</> bytes and might be less
d3210 1
a3210 1
   <link linkend="catalog-pg-largeobject">pg_largeobject</link>.
d3231 1
a3231 1
      <entry>Owner of the largeobject</entry>
d3702 1
a3702 1
      <entry>Name of anonymous-block handler function, or NULL if none</entry>
d3708 1
a3708 1
      <entry>Name of validator function, or NULL if none</entry>
d3862 1
a3862 1
       null inputs
d3922 1
a3922 1
       the call signature of the function
d3936 1
a3936 1
       <structfield>proargtypes</> is subscripted from 0
d3954 1
a3954 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>
d3967 1
a3967 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>
d3981 1
a3981 1
       If none of the arguments have defaults, this field will be null
d3993 1
a3993 1
       else, depending on the implementation language/call convention
d4003 1
a4003 1
       Again, the interpretation is language-specific
d4285 1
a4285 1
       table itself).  For all other object types, this column is zero
d4557 1
a4557 1
      A zero value means the number of distinct values is unknown
d4568 1
a4568 1
       <structname>pg_statistic</structname> row
d4580 1
a4580 1
       that defines the sort order of the data
d4590 1
a4590 1
       <replaceable>N</>th <quote>slot</quote>, or NULL if the slot
d4601 1
a4601 1
       <replaceable>N</>th <quote>slot</quote>, or NULL if the slot
d4605 1
a4605 1
       <type>anyarray</>
d4819 1
a4819 1
      <entry>column numbers, if trigger is column-specific; otherwise an
d4835 1
a4835 1
       representation) for the trigger's <literal>WHEN</> condition, or NULL
d5328 1
a5328 1
       length would allow pass-by-value
d5344 1
a5344 1
       <structfield>typbasetype</structfield>
d5356 1
a5356 1
       See <xref linkend="catalog-typcategory-table">
d5378 1
a5378 1
       except the type name, namespace, and OID can be relied on
d5389 1
a5389 1
       element data type, not the array data type
d5405 1
a5405 1
       Zero for non-composite types
d5427 1
a5427 1
       subroutines
d5488 1
a5488 1
      <entry>Custom ANALYZE function, or 0 to use the standard function</entry>
d5574 1
a5574 1
       constraint on a type.  Used for domains only
d5585 1
a5585 1
       one is based on.  Zero if this type is not a domain
d5596 1
a5596 1
       <literal>typmod</>).  -1 if this type is not a domain
d5609 1
a5609 1
       Zero for types other than domains over array types
d5620 1
a5620 1
       only used for domains
d5636 1
a5636 1
       converter to produce a constant
d5775 1
a5775 1
       User mapping specific options, as <quote>keyword=value</> strings.
d6135 1
a6135 1
      <entry>Name of tablespace containing index (NULL if default for database)</entry>
d6202 1
a6202 1
       type of the lockable object:
d6221 1
a6221 1
       NULL if the object is a transaction ID
d6229 1
a6229 1
       OID of the relation, or NULL if the object is not
d6238 1
a6238 1
       Page number within the relation, or NULL if the object
d6247 1
a6247 1
       Tuple number within the page, or NULL if the object is not a tuple
d6255 1
a6255 1
       Virtual ID of a transaction, or NULL if the object is not a
d6264 1
a6264 1
       ID of a transaction, or NULL if the object is not a transaction ID
d6272 1
a6272 1
       OID of the system catalog containing the object, or NULL if the
d6281 1
a6281 1
       OID of the object within its system catalog, or NULL if the
d6296 1
a6296 1
       zero.  NULL if the object is not a general database object
d6313 1
a6313 1
       lock.  NULL if the lock is held by a prepared transaction
d6461 1
a6461 1
       statement itself
d6478 1
a6478 1
       <type>regtype</type> value to <type>oid</type>
d6684 1
a6684 1
       connections this role can make.  -1 means no limit
d6700 1
a6700 1
       NULL if no expiration</entry>
d6854 1
a6854 1
      <entry>Minimum allowed value of the parameter (NULL for non-numeric
d6860 1
a6860 1
      <entry>Maximum allowed value of the parameter (NULL for non-numeric
d6866 1
a6866 1
      <entry>Allowed values of an enum parameter (NULL for non-enum
d6884 1
a6884 1
      <entry>Configuration file the current value was set in (NULL for
d6886 2
a6887 2
      examined by a non-superuser).
      Helpful when using configuration include directives</entry>
d6893 1
a6893 1
      set at (NULL for values set from sources other than configuration files,
d7110 1
a7110 1
       values is the same as the number of rows
d7119 1
a7119 1
       A list of the most common values in the column. (NULL if
d7121 1
a7121 1
       For some datatypes such as <type>tsvector</>, this is a list of
d7133 2
a7134 2
       (NULL when <structfield>most_common_vals</structfield> is.)
       For some datatypes such as <type>tsvector</>, it can also store some
d7148 1
a7148 1
       histogram calculation.  (This column is NULL if the column data type
d7164 1
a7164 1
       of random access to the disk.  (This column is NULL if the column data
d7229 1
a7229 1
      <entry>Name of tablespace containing table (NULL if default for database)</entry>
d7235 1
a7235 1
      <entry>true if table has (or recently had) any indexes</entry>
d7241 1
a7241 1
      <entry>true if table has (or once had) rules</entry>
d7247 1
a7247 1
      <entry>true if table has (or once had) triggers</entry>
d7518 1
a7518 1
       server, else null.
@


2.225.2.1
log
@Spell and markup checking
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225 2010/04/03 07:22:52 petere Exp $ -->
d347 2
a348 2
       representation.  If this field is null, the transition state
       value starts out null.
d464 1
a464 1
      <entry>Does the access method support <literal>IS NULL</>/<literal>NOT NULL</> searches?</entry>
d895 1
a895 1
       to collect, and the target number of histogram bins to create.
d916 1
a916 1
       have (arbitrary) negative numbers.
d927 1
a927 1
       so any nonzero value effectively means <quote>it's an array</>.)
d951 1
a951 1
       The value will generally be -1 for types that do not need <structfield>atttypmod</>.
d971 1
a971 1
       after column creation to control storage policy.
d990 1
a990 1
       change this column to enable or disable the constraint.
d1001 1
a1001 1
       catalog that actually defines the value.
d1012 1
a1012 1
       ignored by the parser and so cannot be accessed via SQL.
d1022 1
a1022 1
       be locally defined and inherited simultaneously.
d1032 1
a1032 1
       nonzero number of ancestors cannot be dropped nor renamed.
d1166 1
a1166 1
       session authorization identifier.
d1175 1
a1175 1
       connections this role can make.  -1 means no limit.
d1182 1
a1182 1
      <entry>Password (possibly encrypted); null if none</entry>
d1189 1
a1189 1
       null if no expiration</entry>
d1341 1
a1341 1
       other cases.
d1352 1
a1352 1
       <literal>b</> means that the types are binary-coercible, thus no conversion is required.
d1490 1
a1490 1
       <command>CREATE INDEX</command>.
d1502 1
a1502 1
       <command>CREATE INDEX</command>.
d1513 1
a1513 1
       secondary table.
d1522 1
a1522 1
       For a TOAST table, the OID of its index.  0 if not a TOAST table.
d1542 1
a1542 1
       are shared.
d1552 1
a1552 1
       session can safely access its contents.
d1576 1
a1576 1
       <literal>pg_attribute.attnum</literal>.
d1655 1
a1655 1
       (<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
d1684 1
a1684 1
   Several of the Boolean flags in <structname>pg_class</> are maintained
d1850 1
a1850 1
       constraint can be locally defined and inherited simultaneously.
d1861 1
a1861 1
       a nonzero number of ancestors cannot be dropped nor renamed.
d2131 1
a2131 1
       used to protect the <literal>template0</> database from being altered.
d2141 1
a2141 1
       to this database.  -1 means no limit.
d2165 1
a2165 1
       <structname>pg_class</>.<structfield>relfrozenxid</> values.
d2178 1
a2178 1
       system catalogs will be there.
d2276 1
a2276 1
   Note that when an ACL entry in another catalog is null, it is taken
d2343 1
a2343 1
       zero.
d2369 1
a2369 1
       is zero.
d2518 1
a2518 1
       zero.
d2746 1
a2746 1
       Foreign server specific options, as <quote>keyword=value</> strings
d2843 1
a2843 1
       true either.
d2853 1
a2853 1
       of this <structname>pg_index</> row is below their <symbol>TransactionXmin</symbol>
d2866 1
a2866 1
       operations.
d2880 1
a2880 1
       rather than a simple column reference.
d2891 1
a2891 1
       <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
d2902 1
a2902 1
       the index's access method.
d2910 4
a2913 7
      <entry>
       Expression trees (in <function>nodeToString()</function>
       representation) for index attributes that are not simple column
       references.  This is a list with one element for each zero
       entry in <structfield>indkey</>.  Null if all index attributes
       are simple references.
      </entry>
d2920 2
a2921 5
      <entry>
       Expression tree (in <function>nodeToString()</function>
       representation) for partial index predicate.  Null if not a
       partial index.
      </entry>
d2983 1
a2983 1
       inherited columns are to be arranged.  The count starts at 1.
d3044 1
a3044 1
       replaced by a different mechanism in the future.
d3056 1
a3056 1
       languages.
d3080 1
a3080 1
       Zero if inline blocks are not supported.
d3091 1
a3091 1
       are created.  Zero if no validator is provided.
d3136 1
a3136 1
   <link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</></link>
d3175 1
a3175 1
       This will never be more than <symbol>LOBLKSIZE</> bytes and might be less.
d3204 1
a3204 1
   <link linkend="catalog-pg-largeobject"><structname>pg_largeobject</></link>.
d3225 1
a3225 1
      <entry>Owner of the large object</entry>
d3696 1
a3696 1
      <entry>Name of anonymous-block handler function, or null if none</entry>
d3702 1
a3702 1
      <entry>Name of validator function, or null if none</entry>
d3856 1
a3856 1
       null inputs.
d3916 1
a3916 1
       the call signature of the function.
d3930 1
a3930 1
       <structfield>proargtypes</> is subscripted from 0.
d3948 1
a3948 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
d3961 1
a3961 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
d3975 1
a3975 1
       If none of the arguments have defaults, this field will be null.
d3987 1
a3987 1
       else, depending on the implementation language/call convention.
d3997 1
a3997 1
       Again, the interpretation is language-specific.
d4279 1
a4279 1
       table itself).  For all other object types, this column is zero.
d4551 1
a4551 1
      A zero value means the number of distinct values is unknown.
d4562 1
a4562 1
       <structname>pg_statistic</structname> row.
d4574 1
a4574 1
       that defines the sort order of the data.
d4584 1
a4584 1
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
d4595 1
a4595 1
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
d4599 1
a4599 1
       <type>anyarray</>.
d4813 1
a4813 1
      <entry>Column numbers, if trigger is column-specific; otherwise an
d4829 1
a4829 1
       representation) for the trigger's <literal>WHEN</> condition, or null
d5322 1
a5322 1
       length would allow pass-by-value.
d5338 1
a5338 1
       <structfield>typbasetype</structfield>.
d5350 1
a5350 1
       See <xref linkend="catalog-typcategory-table">.
d5372 1
a5372 1
       except the type name, namespace, and OID can be relied on.
d5383 1
a5383 1
       element data type, not the array data type.
d5399 1
a5399 1
       Zero for non-composite types.
d5421 1
a5421 1
       subroutines.
d5482 1
a5482 1
      <entry>Custom <command>ANALYZE</command> function, or 0 to use the standard function</entry>
d5568 1
a5568 1
       constraint on a type.  Used for domains only.
d5579 1
a5579 1
       one is based on.  Zero if this type is not a domain.
d5590 1
a5590 1
       <literal>typmod</>).  -1 if this type is not a domain.
d5603 1
a5603 1
       Zero for types other than domains over array types.
d5614 1
a5614 1
       only used for domains.
d5630 1
a5630 1
       converter to produce a constant.
d5769 1
a5769 1
       User mapping specific options, as <quote>keyword=value</> strings
d6129 1
a6129 1
      <entry>Name of tablespace containing index (null if default for database)</entry>
d6196 1
a6196 1
       Type of the lockable object:
d6215 1
a6215 1
       null if the object is a transaction ID
d6223 1
a6223 1
       OID of the relation, or null if the object is not
d6232 1
a6232 1
       Page number within the relation, or null if the object
d6241 1
a6241 1
       Tuple number within the page, or null if the object is not a tuple
d6249 1
a6249 1
       Virtual ID of a transaction, or null if the object is not a
d6258 1
a6258 1
       ID of a transaction, or null if the object is not a transaction ID
d6266 1
a6266 1
       OID of the system catalog containing the object, or null if the
d6275 1
a6275 1
       OID of the object within its system catalog, or null if the
d6290 1
a6290 1
       zero.  Null if the object is not a general database object
d6307 1
a6307 1
       lock.  Null if the lock is held by a prepared transaction.
d6455 1
a6455 1
       statement itself.
d6472 1
a6472 1
       <type>regtype</type> value to <type>oid</type>.
d6678 1
a6678 1
       connections this role can make.  -1 means no limit.
d6694 1
a6694 1
       null if no expiration</entry>
d6848 1
a6848 1
      <entry>Minimum allowed value of the parameter (null for non-numeric
d6854 1
a6854 1
      <entry>Maximum allowed value of the parameter (null for non-numeric
d6860 1
a6860 1
      <entry>Allowed values of an enum parameter (null for non-enum
d6878 1
a6878 1
      <entry>Configuration file the current value was set in (null for
d6880 2
a6881 2
      examined by a non-superuser);
      helpful when using <literal>include</> directives in configuration files</entry>
d6887 1
a6887 1
      set at (null for values set from sources other than configuration files,
d7104 1
a7104 1
       values is the same as the number of rows.
d7113 1
a7113 1
       A list of the most common values in the column. (Null if
d7115 1
a7115 1
       For some data types such as <type>tsvector</>, this is a list of
d7127 2
a7128 2
       (Null when <structfield>most_common_vals</structfield> is.)
       For some data types such as <type>tsvector</>, it can also store some
d7142 1
a7142 1
       histogram calculation.  (This column is null if the column data type
d7158 1
a7158 1
       of random access to the disk.  (This column is null if the column data
d7223 1
a7223 1
      <entry>Name of tablespace containing table (null if default for database)</entry>
d7229 1
a7229 1
      <entry>True if table has (or recently had) any indexes</entry>
d7235 1
a7235 1
      <entry>True if table has (or once had) rules</entry>
d7241 1
a7241 1
      <entry>True if table has (or once had) triggers</entry>
d7512 1
a7512 1
       server, else null
@


2.225.2.2
log
@Add missing description of reloftype field
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225.2.1 2010/08/17 04:37:15 petere Exp $ -->
a1447 10
      <entry><structfield>reloftype</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
      <entry>
       For typed tables, the OID of the underlying composite type,
       zero for all other relations
      </entry>
     </row>

     <row>
@


2.225.2.3
log
@Link from pg_shadow docs to pg_authid docs.

Per discussion with Josh Kupershmidt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225.2.2 2010/08/25 18:18:38 petere Exp $ -->
d6939 1
a6939 2
   <structfield>rolcanlogin</> in
   <link linkend="catalog-pg-authid">pg_authid</link>.
@


2.225.2.4
log
@Elaborate on what gets stored in pg_authid.rolpasswd.

Also, add cross-reference from pg_shadow.passwd to pg_authid.rolpasswd and
fix a bit of markup I muffed in my previous commit.

Per discussion with Josh Kupershmidt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225.2.3 2010/09/13 01:25:12 rhaas Exp $ -->
d1182 1
a1182 8
      <entry>
       Password (possibly encrypted); null if none.  If the password is
       encrypted, this column will contain the string md5 followed by a
       32-character hexadecimal MD5 hash.  The MD5 hash will be of the
       user's password concatenated to their username (for example, if
       user joe has password xyzzy, <productname>PostgreSQL</> will store
       the md5 hash of xyzzyjoe).
      </entry>
d6940 1
a6940 1
   <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.
d7007 1
a7007 3
      <entry>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.</entry>
@


2.225.2.5
log
@Move pg_db_role_setting docs to correct place in alphabetical order.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.225.2.4 2010/09/13 17:03:23 rhaas Exp $ -->
a116 5
      <entry><link linkend="catalog-pg-db-role-setting"><structname>pg_db_role_setting</structname></link></entry>
      <entry>per-role and per-database settings</entry>
     </row>

     <row>
d207 5
a2215 60
 <sect1 id="catalog-pg-db-role-setting">
  <title><structname>pg_db_role_setting</structname></title>

  <indexterm zone="catalog-pg-db-role-setting">
   <primary>pg_db_role_setting</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_db_role_setting</structname> records the default
   values that have been set for run-time configuration variables,
   for each role and database combination.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_db_role_setting</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_db_role_setting</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_db_role_setting</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>setdatabase</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
      <entry>The OID of the database the setting is applicable to, or zero if not database-specific</entry>
     </row>

     <row>
      <entry><structfield>setrole</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>The OID of the role the setting is applicable to, or zero if not role-specific</entry>
     </row>

     <row>
      <entry><structfield>setconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Defaults for run-time configuration variables</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


d4171 59
@


2.224
log
@Prevent ALTER USER f RESET ALL from removing the settings that were put there
by a superuser -- "ALTER USER f RESET setting" already disallows removing such a
setting.

Apply the same treatment to ALTER DATABASE d RESET ALL when run by a database
owner that's not superuser.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.223 2010/02/17 04:19:37 tgl Exp $ -->
d357 1
a357 1
   linkend="sql-createaggregate" endterm="sql-createaggregate-title">
d889 1
a889 1
       <xref linkend="sql-analyze" endterm="sql-analyze-title">.
d1277 1
a1277 1
   <xref linkend="sql-createcast" endterm="sql-createcast-title">.
d1665 2
a1666 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d1965 1
a1965 1
   <xref linkend="sql-createconversion" endterm="sql-createconversion-title">
d2050 1
a2050 1
   linkend="sql-createdatabase" endterm="sql-createdatabase-title"> command.
d2188 2
a2189 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d2470 1
a2470 1
   with the <xref linkend="sql-comment" endterm="sql-comment-title"> command and viewed with
d2646 2
a2647 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d2735 2
a2736 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d3003 1
a3003 1
   See <xref linkend="sql-createlanguage" endterm="sql-createlanguage-title">
d3079 1
a3079 1
       (<xref linkend="sql-do" endterm="sql-do-title"> blocks).
d3101 2
a3102 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d3234 2
a3235 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d3293 2
a3294 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d3421 1
a3421 1
   See <xref linkend="sql-createoperator" endterm="sql-createoperator-title">
d3748 1
a3748 1
   See <xref linkend="sql-createfunction" endterm="sql-createfunction-title">
d4014 2
a4015 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d4371 1
a4371 2
   manipulated with the <xref linkend="sql-comment"
   endterm="sql-comment-title"> command and viewed with
d4439 1
a4439 1
   created by <xref linkend="sql-analyze" endterm="sql-analyze-title">
d4670 2
a4671 2
       <xref linkend="sql-grant" endterm="sql-grant-title"> and
       <xref linkend="sql-revoke" endterm="sql-revoke-title">
d4699 1
a4699 1
   See <xref linkend="sql-createtrigger" endterm="sql-createtrigger-title">
d5252 1
a5252 1
   <xref linkend="sql-createtype" endterm="sql-createtype-title">, and
d5254 1
a5254 1
   <xref linkend="sql-createdomain" endterm="sql-createdomain-title">.
d5919 1
a5919 1
      via the <xref linkend="sql-declare" endterm="sql-declare-title">
d6416 1
a6416 2
   session. See <xref linkend="sql-prepare"
   endterm="sql-prepare-title"> for more information about prepared
d6424 1
a6424 2
   is released (for example, via the <xref linkend="sql-deallocate"
   endterm="sql-deallocate-title"> command).
d6504 1
a6504 2
   commit (see <xref linkend="sql-prepare-transaction"
   endterm="sql-prepare-transaction-title"> for details).
d6779 2
a6780 2
   interface to the <xref linkend="sql-show" endterm="sql-show-title">
   and <xref linkend="sql-set" endterm="sql-set-title"> commands.
d6899 1
a6899 1
   the <xref linkend="sql-set" endterm="sql-set-title"> command on that named
@


2.223
log
@Stamp HEAD as 9.0devel, and update various places that were referring to 8.5
(hope I got 'em all).  Per discussion, this release will be 9.0 not 8.5.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.222 2010/02/16 22:34:41 tgl Exp $ -->
a1190 6

     <row>
      <entry><structfield>rolconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry>Session defaults for run-time configuration variables</entry>
     </row>
@


2.222
log
@Replace the pg_listener-based LISTEN/NOTIFY mechanism with an in-memory queue.
In addition, add support for a "payload" string to be passed along with
each notify event.

This implementation should be significantly more efficient than the old one,
and is also more compatible with Hot Standby usage.  There is not yet any
facility for HS slaves to receive notifications generated on the master,
although such a thing is possible in future.

Joachim Wieland, reviewed by Jeff Davis; also hacked on by me.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.221 2010/02/07 20:48:09 tgl Exp $ -->
d3137 1
a3137 1
   Prior to <productname>PostgreSQL</> 8.5, there was no permission structure
@


2.221
log
@Create a "relation mapping" infrastructure to support changing the relfilenodes
of shared or nailed system catalogs.  This has two key benefits:

* The new CLUSTER-based VACUUM FULL can be applied safely to all catalogs.

* We no longer have to use an unsafe reindex-in-place approach for reindexing
  shared catalogs.

CLUSTER on nailed catalogs now works too, although I left it disabled on
shared catalogs because the resulting pg_index.indisclustered update would
only be visible in one database.

Since reindexing shared system catalogs is now fully transactional and
crash-safe, the former special cases in REINDEX behavior have been removed;
shared catalogs are treated the same as non-shared.

This commit does not do anything about the recently-discussed problem of
deadlocks between VACUUM FULL/CLUSTER on a system catalog and other
concurrent queries; will address that in a separate patch.  As a stopgap,
parallel_schedule has been tweaked to run vacuum.sql by itself, to avoid
such failures during the regression tests.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.220 2010/02/03 17:25:05 momjian Exp $ -->
a171 5
      <entry><link linkend="catalog-pg-listener"><structname>pg_listener</structname></link></entry>
      <entry>asynchronous notification support</entry>
     </row>

     <row>
a3250 62
 <sect1 id="catalog-pg-listener">
  <title><structname>pg_listener</structname></title>

  <indexterm zone="catalog-pg-listener">
   <primary>pg_listener</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_listener</structname> supports the
   <xref linkend="sql-listen" endterm="sql-listen-title"> and
   <xref linkend="sql-notify" endterm="sql-notify-title">
   commands.  A listener creates an entry in
   <structname>pg_listener</structname> for each notification name
   it is listening for.  A notifier scans <structname>pg_listener</structname>
   and updates each matching entry to show that a notification has occurred.
   The notifier also sends a signal (using the PID recorded in the table)
   to awaken the listener from sleep.
  </para>

  <table>
   <title><structname>pg_listener</> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>relname</structfield></entry>
      <entry><type>name</type></entry>
      <entry>
       Notify condition name.  (The name need not match any actual
       relation in the database; the name <structfield>relname</> is historical.)
      </entry>
     </row>

     <row>
      <entry><structfield>listenerpid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry>PID of the server process that created this entry</entry>
     </row>

     <row>
      <entry><structfield>notification</structfield></entry>
      <entry><type>int4</type></entry>
      <entry>
       Zero if no event is pending for this listener.  If an event is
       pending, the PID of the server process that sent the notification
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


@


2.220
log
@Proofreading improvements for the Administration documentation book.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.219 2010/01/22 16:40:18 rhaas Exp $ -->
d1476 3
a1478 1
      <entry>Name of the on-disk file of this relation; 0 if none</entry>
@


2.219
log
@Replace ALTER TABLE ... SET STATISTICS DISTINCT with a more general mechanism.

Attributes can now have options, just as relations and tablespaces do, and
the reloptions code is used to parse, validate, and store them.  For
simplicity and because these options are not performance critical, we store
them in a separate cache rather than the main relcache.

Thanks to Alex Hunsaker for the review.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.218 2010/01/17 22:56:21 tgl Exp $ -->
d5572 3
a5574 1
      </para><para>
@


2.218
log
@Improve the handling of SET CONSTRAINTS commands by having them search
pg_constraint before searching pg_trigger.  This allows saner handling of
corner cases; in particular we now say "constraint is not deferrable"
rather than "constraint does not exist" when the command is applied to
a constraint that's inherently non-deferrable.  Per a gripe several months
ago from hubert depesz lubaczewski.

To make this work without breaking user-defined constraint triggers,
we have to add entries for them to pg_constraint.  However, in return
we can remove the pgconstrname column from pg_constraint, which represents
a fairly sizable space savings.  I also replaced the tgisconstraint column
with tgisinternal; the old meaning of tgisconstraint can now be had by
testing for nonzero tgconstraint, while there is no other way to get
the old meaning of nonzero tgconstraint, namely that the trigger was
internally generated rather than being user-created.

In passing, fix an old misstatement in the docs and comments, namely that
pg_trigger.tgdeferrable is exactly redundant with pg_constraint.condeferrable.
Actually, we mark RI action triggers as nondeferrable even when they belong to
a nominally deferrable FK constraint.  The SET CONSTRAINTS code now relies on
that instead of hard-coding a list of exception OIDs.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.217 2010/01/10 01:23:08 rhaas Exp $ -->
a904 13
      <entry><structfield>attdistinct</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>
       <structfield>attdistinct</structfield>, if nonzero, is a user-specified
       number-of-distinct-values figure to be used instead of estimating the
       number of distinct values during <command>ANALYZE</>.  Nonzero values
       have the same meanings as for
       <link linkend="catalog-pg-statistic"><structname>pg_statistic</></link>.<structfield>stadistinct</>
      </entry>
     </row>

     <row>
d1051 9
@


2.217
log
@Document pg_tablespace.spcoptions.

This should have been part of the original tablespace-options patch, but I
overlooked the need to update this portion of the documentation.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.216 2010/01/01 21:53:48 tgl Exp $ -->
d1725 5
d1772 1
d1882 2
a1883 1
      <entry>If a table constraint (including a foreign key), list of the constrained columns</entry>
d4836 1
a4836 1
      <entry><structfield>tgisconstraint</structfield></entry>
d4839 2
a4840 8
      <entry>True if trigger is a <quote>constraint trigger</></entry>
     </row>

     <row>
      <entry><structfield>tgconstrname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Constraint name, if a constraint trigger</entry>
d4861 1
a4861 1
      <entry>The <structname>pg_constraint</> entry owning the trigger, if any</entry>
d4923 6
a4928 7
    <structfield>tgisconstraint</> must be true, and
    <structfield>tgconstrname</>, <structfield>tgconstrrelid</>,
    <structfield>tgconstrindid</>,
    <structfield>tgdeferrable</>, <structfield>tginitdeferred</> are redundant
    with the referenced <structname>pg_constraint</> entry.  The reason we
    keep these fields is that we support <quote>stand-alone</> constraint
    triggers with no corresponding <structname>pg_constraint</> entry.
@


2.216
log
@Support "x IS NOT NULL" clauses as indexscan conditions.  This turns out
to be just a minor extension of the previous patch that made "x IS NULL"
indexable, because we can treat the IS NOT NULL condition as if it were
"x < NULL" or "x > NULL" (depending on the index's NULLS FIRST/LAST option),
just like IS NULL is treated like "x = NULL".  Aside from any possible
usefulness in its own right, this is an important improvement for
index-optimized MAX/MIN aggregates: it is now reliably possible to get
a column's min or max value cheaply, even when there are a lot of nulls
cluttering the interesting end of the index.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.215 2009/12/29 20:11:42 tgl Exp $ -->
d4744 9
@


2.215
log
@Add the ability to store inheritance-tree statistics in pg_statistic,
and teach ANALYZE to compute such stats for tables that have subclasses.
Per my proposal of yesterday.

autovacuum still needs to be taught about running ANALYZE on parent tables
when their subclasses change, but the feature is useful even without that.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.214 2009/12/17 14:36:15 rhaas Exp $ -->
d469 1
a469 1
      <entry>Does the access method support IS NULL searches?</entry>
@


2.214
log
@Improve documentation for pg_largeobject changes.

Rewrite the documentation in more idiomatic English, and in the process make
it somewhat more succinct.  Move the discussion of specific large object
privileges out of the "server-side functions" section, where it certainly
doesn't belong, and into "implementation features".  That might not be
exactly right either, but it doesn't seem worth creating a new section for
this amount of information. Fix a few spelling and layout problems, too.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.213 2009/12/11 03:34:54 itagaki Exp $ -->
d4509 1
a4509 2
   and subsequently used by the query planner.  There is one entry for
   each table column that has been analyzed.  Note that all the
d4515 13
d4533 2
a4534 1
   for the underlying table column.
d4589 8
d7139 8
@


2.213
log
@Add large object access control.

A new system catalog pg_largeobject_metadata manages
ownership and access privileges of large objects.

KaiGai Kohei, reviewed by Jaime Casanova.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.212 2009/12/07 05:22:21 tgl Exp $ -->
d3128 2
a3129 3
   <quote>large objects</quote>.  A large object is identified by an OID of
   <link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</></link>
   catalog, assigned when it is created.  Each large object is broken into
d3137 7
a3143 4
   <structname>pg_largeobject</structname> should not be readable by the
   public, since the catalog contains data in large objects of all users.
   <structname>pg_largeobject_metadata</> is a publicly readable catalog
   that only contains identifiers of large objects.
d3207 4
a3210 3
   The purpose of <structname>pg_largeobject_metadata</structname> is to
   hold metadata of <quote>large objects</quote>, such as OID of its owner,
   access permissions and OID of the large object itself.
d3231 1
a3231 1
      <entry>Owner of the largeobejct</entry>
d3237 1
@


2.212
log
@Add exclusion constraints, which generalize the concept of uniqueness to
support any indexable commutative operator, not just equality.  Two rows
violate the exclusion constraint if "row1.col OP row2.col" is TRUE for
each of the columns in the constraint.

Jeff Davis, reviewed by Robert Haas
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.211 2009/11/20 20:38:09 tgl Exp $ -->
d163 6
a168 1
      <entry>large objects</entry>
d3128 3
a3130 2
   <quote>large objects</quote>.  A large object is identified by an
   OID assigned when it is created.  Each large object is broken into
d3137 7
d3147 1
a3147 1
   <tgroup cols="3">
d3152 1
d3161 1
d3168 1
d3176 1
d3197 49
@


2.211
log
@Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be
checked to determine whether the trigger should be fired.

For BEFORE triggers this is mostly a matter of spec compliance; but for AFTER
triggers it can provide a noticeable performance improvement, since queuing of
a deferred trigger event and re-fetching of the row(s) at end of statement can
be short-circuited if the trigger does not need to be fired.

Takahiro Itagaki, reviewed by KaiGai Kohei.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.210 2009/10/14 22:14:21 tgl Exp $ -->
d1539 1
a1539 5
       True if this is a table and it has (or recently had) any
       indexes. This is set by <command>CREATE INDEX</command>, but
       not cleared immediately by <command>DROP INDEX</command>.
       <command>VACUUM</command> clears <structfield>relhasindex</> if it finds the
       table has no indexes
d1617 11
d1690 11
d1711 6
a1716 5
   The catalog <structname>pg_constraint</structname> stores check, primary key, unique, and foreign
   key constraints on tables.  (Column constraints are not treated
   specially.  Every column constraint is equivalent to some table
   constraint.)  Not-null constraints are represented in the
   <structname>pg_attribute</> catalog.
d1761 2
a1762 1
        <literal>u</> = unique constraint
d1799 1
a1799 1
       key, or foreign key constraint; else 0</entry>
d1851 1
a1851 1
       This constraint is defined locally in the relation.  Note that a
d1861 2
a1862 1
       The number of direct ancestors this constraint has.  A constraint with
d1903 7
d1926 10
d1949 2
a1950 1
    relation.
@


2.210
log
@Support SQL-compliant triggers on columns, ie fire only if certain columns
are named in the UPDATE's SET list.

Note: the schema of pg_trigger has not actually changed; we've just started
to use a column that was there all along.  catversion bumped anyway so that
this commit is included in the history of potentially interesting changes
to system catalog contents.

Itagaki Takahiro
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.209 2009/10/07 22:14:14 alvherre Exp $ -->
d4759 9
@


2.209
log
@Make it possibly to specify GUC params per user and per database.

Create a new catalog pg_db_role_setting where they are now stored, and better
encapsulate the code that deals with settings into its realm.  The old
datconfig and rolconfig columns are removed.

psql has gained a \drds command to display the settings.

Backwards compatibility warning: while the backwards-compatible system views
still have the config columns, they no longer completely represent the
configuration for a user or database.

Catalog version bumped.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.208 2009/10/05 19:24:32 tgl Exp $ -->
d4748 3
a4750 2
      <entry></entry>
      <entry>Currently unused</entry>
d4763 8
@


2.208
log
@Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust
the privileges that will be applied to subsequently-created objects.

Such adjustments are always per owning role, and can be restricted to objects
created in particular schemas too.  A notable benefit is that users can
override the traditional default privilege settings, eg, the PUBLIC EXECUTE
privilege traditionally granted by default for functions.

Petr Jelinek
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.207 2009/09/22 23:43:37 tgl Exp $ -->
d207 5
a2144 7
      <entry><structfield>datconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Session defaults for run-time configuration variables</entry>
     </row>

     <row>
d4107 59
a6617 7
      <entry><structfield>rolconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Session defaults for run-time configuration variables</entry>
     </row>

     <row>
@


2.207
log
@Implement the DO statement to support execution of PL code without having
to create a function for it.

Procedural languages now have an additional entry point, namely a function
to execute an inline code block.  This seemed a better design than trying
to hide the transient-ness of the code from the PL.  As of this patch, only
plpgsql has an inline handler, but probably people will soon write handlers
for the other standard PLs.

In passing, remove the long-dead LANCOMPILER option of CREATE LANGUAGE.

Petr Jelinek
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.206 2009/08/10 22:13:50 alvherre Exp $ -->
d117 5
d2163 87
@


2.206
log
@Fix number of columns declared for pg_user_mappings description table.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.205 2009/08/04 04:04:11 tgl Exp $ -->
d2945 12
d3563 6
@


2.205
log
@Cause pg_proc.probin to be declared as text, not bytea.  Everything was
already treating it as text anyway, to the point that I couldn't find anything
to change except the datatype markings in catalog/*.h.  The only effect that
the bytea declaration had was to cause byteaout() to be invoked when pg_dump
(or another client program) inspected the column value.  Since pg_dump wasn't
expecting that, but just treating what it got as text, the net result is that
dump and reload would mangle any backslashes or non-ASCII characters in the
filename string for a C-language function.  That is a very long-standing bug,
but given the lack of field complaints it doesn't seem worth trying to find
a back-patchable fix.  We'll just make this change to fix it going forward.

This change will also forestall problems after the planned change to let bytea
emit hex output instead of escaped characters.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.204 2009/08/02 22:14:51 tgl Exp $ -->
d7207 1
a7207 1
   <tgroup cols="3">
@


2.204
log
@Add ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCT

Robert Haas
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.203 2009/07/29 20:56:17 tgl Exp $ -->
d3844 1
a3844 1
      <entry><type>bytea</type></entry>
@


2.203
log
@Support deferrable uniqueness constraints.

The current implementation fires an AFTER ROW trigger for each tuple that
looks like it might be non-unique according to the index contents at the
time of insertion.  This works well as long as there aren't many conflicts,
but won't scale to massive unique-key reassignments.  Improving that case
is a TODO item.

Dean Rasheed
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.202 2009/07/28 02:56:29 tgl Exp $ -->
d890 13
d4319 4
a4322 3
      A value less than zero is the negative of a fraction of the number
      of rows in the table (for example, a column in which values appear about
      twice on the average could be represented by <structfield>stadistinct</> = -0.5).
@


2.202
log
@Add system catalog columns pg_constraint.conindid and pg_trigger.tgconstrindid.

conindid is the index supporting a constraint.  We can use this not only for
unique/primary-key constraints, but also foreign-key constraints, which
depend on the unique index that constrains the referenced columns.
tgconstrindid is just copied from the constraint's conindid field, or is
zero for triggers not associated with constraints.

This is mainly intended as infrastructure for upcoming patches, but it has
some virtue in itself, since it exposes a relationship that you formerly
had to grovel in pg_depend to determine.  I simplified one information_schema
view accordingly.  (There is a pg_dump query that could also use conindid,
but I left it alone because it wasn't clear it'd get any faster.)
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.201 2009/07/01 23:57:33 tgl Exp $ -->
d2679 8
@


2.201
log
@Remove useless References column for pg_listener catalog description.  Per Shigehiro Honda.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.200 2009/03/31 17:59:55 tgl Exp $ -->
d1752 8
d4522 7
d4578 1
@


2.200
log
@Add a "relistemp" boolean column to pg_class, which is true for temporary
relations (including a temp table's indexes and toast table/index), and
false for normal relations.  For ease of checking, this commit just adds
the column and fills it correctly --- revising the relation access machinery
to use it will come separately.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.199 2009/03/05 23:06:45 tgl Exp $ -->
d3033 1
a3033 1
   <tgroup cols="4">
a3037 1
      <entry>References</entry>
@


2.200.2.1
log
@Remove useless References column for pg_listener catalog description.  Per Shigehiro Honda.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.200 2009/03/31 17:59:55 tgl Exp $ -->
d3033 1
a3033 1
   <tgroup cols="3">
d3038 1
@


2.200.2.2
log
@Fix number of columns declared for pg_user_mappings description table.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.200.2.1 2009-07-01 23:57:45 tgl Exp $ -->
d7169 1
a7169 1
   <tgroup cols="4">
@


2.199
log
@Teach the planner to support index access methods that only implement
amgettuple or only implement amgetbitmap, instead of the former assumption
that every AM supports both APIs.  Extracted with minor editorialization
from Teodor's fast-GIN-insert patch; whatever becomes of that, this seems
like a simple and reasonable generalization of the index AM interface spec.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.198 2009/02/24 10:06:31 petere Exp $ -->
d1536 10
@


2.198
log
@Add the possibility to specify an explicit validator function for foreign-data
wrappers (similar to procedural languages).  This way we don't need to retain
the nearly empty libraries, and we are more free in how to implement the
wrapper API in the future.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.197 2009/02/09 20:57:59 alvherre Exp $ -->
d496 1
a496 1
      <entry><quote>Next valid tuple</quote> function</entry>
d503 1
a503 1
      <entry><quote>Fetch all valid tuples</quote> function</entry>
@


2.197
log
@Update autovacuum to use reloptions instead of a system catalog, for
per-table overrides of parameters.

This removes a whole class of problems related to misusing the catalog,
and perhaps more importantly, gives us pg_dump support for the parameters.

Based on a patch by Euler Taveira de Oliveira, heavily reworked by me.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.196 2009/02/07 19:27:25 momjian Exp $ -->
d2469 10
a2478 4
      <entry><structfield>fdwlibrary</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>File name of the library implementing this foreign-data wrapper</entry>
@


2.196
log
@Uppercase CHECK mention in relchecks documentation mention.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.195 2009/02/07 15:00:27 momjian Exp $ -->
a91 5
      <entry><link linkend="catalog-pg-autovacuum"><structname>pg_autovacuum</structname></link></entry>
      <entry>per-relation autovacuum configuration parameters</entry>
     </row>

     <row>
a1253 172
 <sect1 id="catalog-pg-autovacuum">
  <title><structname>pg_autovacuum</structname></title>

  <indexterm zone="catalog-pg-autovacuum">
   <primary>pg_autovacuum</primary>
  </indexterm>

  <indexterm zone="catalog-pg-autovacuum">
   <primary>autovacuum</primary>
   <secondary>table-specific configuration</secondary>
  </indexterm>

  <para>
   The catalog <structname>pg_autovacuum</structname> stores optional
   per-relation configuration parameters for the autovacuum daemon.
   If there is an entry here for a particular relation, the given
   parameters will be used for autovacuuming that table.  If no entry
   is present, the system-wide defaults will be used. For more information
   about the autovacuum daemon, see <xref linkend="autovacuum">.
  </para>

  <note>
   <para>
    It is likely that <structname>pg_autovacuum</structname> will disappear
    in a future release, with the information instead being kept in
    <structname>pg_class</>.<structfield>reloptions</> entries.
   </para>
  </note>

  <table>
   <title><structname>pg_autovacuum</> Columns</title>

   <tgroup cols="4">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>vacrelid</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
      <entry>The table this entry is for</entry>
     </row>

     <row>
      <entry><structfield>enabled</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>If false, this table will not be autovacuumed, except
       to prevent transaction ID wraparound</entry>
     </row>

     <row>
      <entry><structfield>vac_base_thresh</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Minimum number of modified tuples before vacuum</entry>
     </row>

     <row>
      <entry><structfield>vac_scale_factor</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>Multiplier for <structfield>reltuples</> to add to
       <structfield>vac_base_thresh</></entry>
     </row>

     <row>
      <entry><structfield>anl_base_thresh</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Minimum number of modified tuples before analyze</entry>
     </row>

     <row>
      <entry><structfield>anl_scale_factor</structfield></entry>
      <entry><type>float4</type></entry>
      <entry></entry>
      <entry>Multiplier for <structfield>reltuples</> to add to
       <structfield>anl_base_thresh</></entry>
     </row>

     <row>
      <entry><structfield>vac_cost_delay</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Custom <varname>vacuum_cost_delay</> parameter</entry>
     </row>

     <row>
      <entry><structfield>vac_cost_limit</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Custom <varname>vacuum_cost_limit</> parameter</entry>
     </row>

     <row>
      <entry><structfield>freeze_min_age</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Custom <varname>vacuum_freeze_min_age</> parameter</entry>
     </row>

     <row>
      <entry><structfield>freeze_max_age</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Custom <varname>autovacuum_freeze_max_age</> parameter</entry>
     </row>

     <row>
      <entry><structfield>freeze_table_age</structfield></entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry>Custom <varname>vacuum_freeze_table_age</> parameter</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The autovacuum daemon will initiate a <command>VACUUM</> operation
   on a particular table when the number of updated or deleted tuples
   exceeds <structfield>vac_base_thresh</structfield> plus
   <structfield>vac_scale_factor</structfield> times the number of
   live tuples currently estimated to be in the relation.
   Similarly, it will initiate an <command>ANALYZE</> operation
   when the number of inserted, updated or deleted tuples
   exceeds <structfield>anl_base_thresh</structfield> plus
   <structfield>anl_scale_factor</structfield> times the number of
   live tuples currently estimated to be in the relation.
  </para>

  <para>
   Also, the autovacuum daemon will perform a <command>VACUUM</> operation
   to prevent transaction ID wraparound if the table's
   <structname>pg_class</>.<structfield>relfrozenxid</> field attains an age
   of more than <structfield>freeze_max_age</> transactions, whether the table
   has been changed or not, even if
   <structname>pg_autovacuum</>.<structfield>enabled</> is set to
   <literal>false</> for it.  The system will launch autovacuum to perform
   such <command>VACUUM</>s even if autovacuum is otherwise disabled.
   See <xref linkend="vacuum-for-wraparound"> for more about wraparound
   prevention.
  </para>

  <para>
   Any of the numerical fields can contain <literal>-1</> (or indeed
   any negative value) to indicate that the system-wide default should
   be used for this particular value.  Observe that the
   <structfield>vac_cost_delay</> variable inherits its default value from the
   <xref linkend="guc-autovacuum-vacuum-cost-delay"> configuration parameter,
   or from <xref linkend="guc-vacuum-cost-delay"> if the former is set to a
   negative value.  The same applies to <structfield>vac_cost_limit</>.
   Also, autovacuum will ignore attempts to set a per-table
   <structfield>freeze_max_age</> larger than the system-wide setting (it can
   only be set smaller), and the <structfield>freeze_min_age</> value will be
   limited to half the system-wide <xref
   linkend="guc-autovacuum-freeze-max-age"> setting.  Note that while you
   can set <structfield>freeze_max_age</> very small, or even zero, this
   is usually unwise since it will force frequent vacuuming.
  </para>

 </sect1>


@


2.195
log
@Update pg_constraint.conkey documentation description.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.194 2009/02/04 21:30:41 alvherre Exp $ -->
d1741 1
a1741 1
       Number of check constraints on the table; see
@


2.194
log
@Fix some SGML-compiler warnings on -wxml mode.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.193 2009/02/02 09:49:29 petere Exp $ -->
d1986 1
a1986 1
      <entry>If a table constraint, list of columns which the constraint constrains</entry>
@


2.193
log
@Put pg_user_mapping section into the right (alphabetical) order.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.192 2009/01/27 12:40:14 petere Exp $ -->
d295 1
a295 1
   <tgroup cols=4>
d378 1
a378 1
   <tgroup cols=4>
d599 1
a599 1
   <tgroup cols=4>
d685 1
a685 1
   <tgroup cols=4>
d768 1
a768 1
   <tgroup cols=4>
d845 1
a845 1
   <tgroup cols=4>
d1097 1
a1097 1
   <tgroup cols=3>
d1213 1
a1213 1
   <tgroup cols=4>
d1291 1
a1291 1
   <tgroup cols=4>
d1459 1
a1459 1
   <tgroup cols=4>
d1574 1
a1574 1
   <tgroup cols=4>
d1851 1
a1851 1
   <tgroup cols=4>
d2070 1
a2070 1
   <tgroup cols=4>
d2163 1
a2163 1
   <tgroup cols=4>
d2328 1
a2328 1
   <tgroup cols=4>
d2503 1
a2503 1
   <tgroup cols=4>
d2573 1
a2573 1
   <tgroup cols=4>
d2620 1
a2620 1
   <tgroup cols=4>
d2695 1
a2695 1
   <tgroup cols=4>
d2783 1
a2783 1
   <tgroup cols=4>
d2951 1
a2951 1
   <tgroup cols=4>
d3014 1
a3014 1
   <tgroup cols=4>
d3125 1
a3125 1
   <tgroup cols=3>
d3194 1
a3194 1
   <tgroup cols=4>
d3252 1
a3252 1
   <tgroup cols=4>
d3320 1
a3320 1
   <tgroup cols=4>
d3418 1
a3418 1
   <tgroup cols=4>
d3568 1
a3568 1
   <tgroup cols=4>
d3649 1
a3649 1
   <tgroup cols=3>
d3745 1
a3745 1
   <tgroup cols=4>
d4033 1
a4033 1
   <tgroup cols=4>
d4164 1
a4164 1
   <tgroup cols=4>
d4317 1
a4317 1
   <tgroup cols=4>
d4407 1
a4407 1
   <tgroup cols=4>
d4536 1
a4536 1
   <tgroup cols=4>
d4601 1
a4601 1
   <tgroup cols=4>
d4767 1
a4767 1
   <tgroup cols=4>
d4835 1
a4835 1
   <tgroup cols=4>
d4906 1
a4906 1
   <tgroup cols=4>
d4982 1
a4982 1
   <tgroup cols=4>
d5072 1
a5072 1
   <tgroup cols=4>
d5139 1
a5139 1
   <tgroup cols=4>
d5521 1
a5521 1
   <tgroup cols=2>
d5611 1
a5611 1
   <tgroup cols=4>
d5833 1
a5833 1
   <tgroup cols=3>
d5919 1
a5919 1
   <tgroup cols=4>
d5971 1
a5971 1
   <tgroup cols=4>
d6055 1
a6055 1
   <tgroup cols=4>
d6306 1
a6306 1
   <tgroup cols=3>
d6393 1
a6393 1
   <tgroup cols=4>
d6482 1
a6482 1
   <tgroup cols=4>
d6608 1
a6608 1
   <tgroup cols=4>
d6673 1
a6673 1
   <tgroup cols=3>
d6821 1
a6821 1
   <tgroup cols=4>
d6923 1
a6923 1
   <tgroup cols=4>
d7067 1
a7067 1
   <tgroup cols=4>
d7142 1
a7142 1
   <tgroup cols=3>
d7194 1
a7194 1
   <tgroup cols=3>
d7247 1
a7247 1
   <tgroup cols=3>
d7331 1
a7331 1
   <tgroup cols=3>
d7412 1
a7412 1
   <tgroup cols=4>
@


2.192
log
@Revert updatable views
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.191 2009/01/22 20:15:59 tgl Exp $ -->
a2766 59
 <sect1 id="catalog-pg-user-mapping">
  <title><structname>pg_user_mapping</structname></title>

  <indexterm zone="catalog-pg-user-mapping">
   <primary>pg_user_mapping</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_user_mapping</structname> stores
   the mappings from local user to remote.  Access to this catalog is
   restricted from normal users, use the view
   <link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link>
   instead.
  </para>

  <table>
   <title><structname>pg_user_mapping</> Columns</title>

   <tgroup cols=4>
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>umuser</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
      <entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
     </row>

     <row>
      <entry><structfield>umserver</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
      <entry>
       The OID of the foreign server that contains this mapping
      </entry>
     </row>

     <row>
      <entry><structfield>umoptions</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>
       User mapping specific options, as <quote>keyword=value</> strings.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>


d5592 60
@


2.191
log
@Support column-level privileges, as required by SQL standard.

Stephen Frost, with help from KaiGai Kohei and others
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.190 2009/01/22 17:27:54 petere Exp $ -->
a4157 7
      <entry><structfield>is_auto</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>True if the rule was automatically generated</entry>
     </row>

     <row>
@


2.190
log
@Automatic view update rules

Bernd Helmle
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.189 2009/01/16 13:27:23 heikki Exp $ -->
d1031 10
d4264 11
@


2.189
log
@Add vacuum_freeze_table_age GUC option, to control when VACUUM should
ignore the visibility map and scan the whole table, to advance
relfrozenxid.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.188 2009/01/09 15:02:22 momjian Exp $ -->
d4148 7
@


2.188
log
@Remove tabs from SGML docs.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.187 2009/01/09 01:53:10 adunstan Exp $ -->
d1364 7
@


2.187
log
@Document values for pg_constraint confupdtype, confdeltype and confmatchtype columns.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.186 2008/12/19 18:25:19 tgl Exp $ -->
d1913 6
a1918 6
	    <literal>a</> = no action,
	    <literal>r</> = restrict,
	    <literal>c</> = cascade,
	    <literal>n</> = set null,
	    <literal>d</> = set default
	  </entry>
d1926 6
a1931 6
	    <literal>a</> = no action,
	    <literal>r</> = restrict,
	    <literal>c</> = cascade,
	    <literal>n</> = set null,
	    <literal>d</> = set default
	  </entry>
d1939 4
a1942 4
	    <literal>f</> = full,
	    <literal>p</> = partial,
	    <literal>u</> = simple (unspecified)
	  </entry>
@


2.186
log
@Add a new column proiswindow to pg_proc.  It doesn't actually do anything
useful yet, but I'm tired of re-merging this aspect of the window functions
patch.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.185 2008/12/19 16:25:16 petere Exp $ -->
d1912 7
a1918 1
      <entry>Foreign key update action code</entry>
d1925 7
a1931 1
      <entry>Foreign key deletion action code</entry>
d1938 5
a1942 1
      <entry>Foreign key match type</entry>
@


2.185
log
@SQL/MED catalog manipulation facilities

This doesn't do any remote or external things yet, but it gives modules
like plproxy and dblink a standardized and future-proof system for
managing their connection information.

Martin Pihlak and Peter Eisentraut
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.184 2008/12/18 18:20:33 tgl Exp $ -->
d3844 7
@


2.184
log
@Code review for function default parameters patch.  Fix numerous problems as
per recent discussions.  In passing this also fixes a couple of bugs in
the previous variadic-parameters patch.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.183 2008/11/21 19:31:58 mha Exp $ -->
d137 10
d260 5
d2570 223
d7260 85
@


2.183
log
@Docs update for enumvals patch.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.182 2008/11/10 00:49:36 tgl Exp $ -->
d3656 8
a3663 1
      <entry>Number of arguments</entry>
d3731 14
@


2.182
log
@Make relhasrules and relhastriggers work like relhasindex, namely we let
VACUUM reset them to false rather than trying to clean 'em up during DROP.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.181 2008/11/09 21:24:32 tgl Exp $ -->
d6432 1
a6432 1
      <entry><type>text</type></entry>
@


2.181
log
@Replace pg_class.reltriggers with relhastriggers, which is just a boolean hint
("there might be triggers") rather than an exact count.  This is necessary
catalog infrastructure for the upcoming patch to reduce the strength of
locking needed for trigger addition/removal.  Split out and committed
separately for ease of reviewing/testing.

In passing, also get rid of the unused pg_class columns relukeys, relfkeys,
and relrefs, which haven't been maintained in many years and now have no
chance of ever being maintained (because of wishing to avoid locking).

Simon Riggs
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.180 2008/10/31 08:39:19 heikki Exp $ -->
d4481 7
@


2.180
log
@Add support for user-defined I/O conversion casts.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.179 2008/10/17 22:10:29 tgl Exp $ -->
d1715 2
a1716 2
      <entry><structfield>reltriggers</structfield></entry>
      <entry><type>int2</type></entry>
d1719 1
a1719 2
       Number of triggers on the table; see
       <link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
d1724 1
a1724 22
      <entry><structfield>relukeys</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Unused  (<emphasis>not</emphasis> the number of unique keys)</entry>
     </row>

     <row>
      <entry><structfield>relfkeys</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Unused  (<emphasis>not</emphasis> the number of foreign keys on the table)</entry>
     </row>

     <row>
      <entry><structfield>relrefs</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Unused</entry>
     </row>

     <row>
      <entry><structfield>relhasoids</structfield></entry>
d1728 1
a1728 1
       True if we generate an OID for each row of the relation
d1733 1
a1733 1
      <entry><structfield>relhaspkey</structfield></entry>
d1737 2
a1738 1
       True if the table has (or once had) a primary key
d1743 1
a1743 1
      <entry><structfield>relhasrules</structfield></entry>
d1747 2
a1748 2
       True if table has rules; see
       <link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
a4480 7
  <note>
   <para>
    <literal>pg_class.reltriggers</literal> needs to agree with the
    number of triggers found in this table for each relation.
   </para>
  </note>

d6793 1
a6793 1
      <entry>true if table has rules</entry>
d6798 2
a6799 2
      <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.reltriggers</literal></entry>
      <entry>true if table has triggers</entry>
@


2.179
log
@Add a new column to pg_am to specify whether an index AM supports backward
scanning; GiST and GIN do not, and it seems like too much trouble to make
them do so.  By teaching ExecSupportsBackwardScan() about this restriction,
we ensure that the planner will protect a scroll cursor from the problem
by adding a Materialize node.

In passing, fix another longstanding bug in the same area: backwards scan of
a plan with set-returning functions in the targetlist did not work either,
since the TupFromTlist expansion code pays no attention to direction (and
has no way to run a SRF backwards anyway).  Again the fix is to make
ExecSupportsBackwardScan check this restriction.

Also adjust the index AM API specification to note that mark/restore support
is unnecessary if the AM can't produce ordered output.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.178 2008/10/06 13:59:37 tgl Exp $ -->
d1418 4
a1421 3
   <quote>I/O conversion casts</>, those performed using a data type's own
   I/O functions to convert to or from <type>text</> or other string types,
   are not explicitly represented in <structname>pg_cast</structname>.
d1458 1
a1458 2
       stored if the data types are binary coercible (that is, no
       run-time operation is needed to perform the cast)
d1476 11
@


2.178
log
@Editorial improvements to description of pg_settings view.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.177 2008/10/06 13:05:36 mha Exp $ -->
d405 7
@


2.177
log
@Add columns boot_val and reset_val to the pg_settings view, to expose
the value a parameter has at server start and will have after RESET,
respectively.

Greg Smith, with some modifications by me.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.176 2008/09/23 09:20:33 heikki Exp $ -->
d6355 2
a6356 1
   interface to the <command>SHOW</> and <command>SET</> commands.
d6402 1
a6402 1
      <entry>Additional, more detailed, information about the parameter</entry>
d6436 1
a6436 1
      <entry>Allowed values in enum parameters (NULL for non-enum
d6448 2
a6449 2
      <entry>Default run-time session value for the parameter that it will
      revert to if <command>RESET</command></entry>
d6454 4
a6457 3
      <entry>Input file the current value was set from (NULL for values set in
      sources other than configuration files).  Helpful when using
      configuration include directives.</entry>
d6461 4
a6464 3
      <entry><type>text</type></entry>
      <entry>Line number within the sourcefile the current value was set
      from (NULL for values set in sources other than configuration files)
@


2.176
log
@Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
ctype are now more like encoding, stored in new datcollate and datctype
columns in pg_database.

This is a stripped-down version of Radek Strnad's patch, with further
changes by me.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.175 2008/09/19 19:03:40 tgl Exp $ -->
d6439 12
@


2.175
log
@Create a selectivity estimation function for the text search @@@@ operator.

Jan Urbanski
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.174 2008/09/15 18:43:41 tgl Exp $ -->
d2153 14
@


2.174
log
@Change hash indexes to store only the hash code rather than the whole indexed
value.  This means that hash index lookups are always lossy and have to be
rechecked when the heap is visited; however, the gain in index compactness
outweighs this when the indexed values are wide.  Also, we only need to
perform datatype comparisons when the hash codes match exactly, rather than
for every entry in the hash bucket; so it could also win for datatypes that
have expensive comparison functions.  A small additional win is gained by
keeping hash index pages sorted by hash code and using binary search to reduce
the number of index tuples we have to look at.

Xiao Meng

This commit also incorporates Zdenek Kotala's patch to isolate hash metapages
and hash bitmaps a bit better from the page header datastructures.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.173 2008/09/10 18:09:19 alvherre Exp $ -->
d6667 3
@


2.173
log
@Add "source file" and "source line" information to each GUC variable.

initdb forced due to changes in the pg_settings view.

Magnus Hagander and Alvaro Herrera.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.172 2008/07/30 17:05:04 tgl Exp $ -->
d455 7
d6434 1
a6434 1
      <entry>Line number within the sourcefile the current value was set 
@


2.172
log
@Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation.  Instead put the information into two new pg_type columns,
typcategory and typispreferred.  Add support for setting these when
creating a user-defined base type.

The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character.  This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.

In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums.  In particular the default preferred state
for user-defined types remains TRUE.  That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.171 2008/07/18 03:32:51 tgl Exp $ -->
d6417 14
@


2.171
log
@Implement SQL-spec RETURNS TABLE syntax for functions.

(Unlike the original submission, this patch treats TABLE output parameters
as being entirely equivalent to OUT parameters -- tgl)

Pavel Stehule
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.170 2008/07/16 16:55:23 tgl Exp $ -->
d997 1
a997 1
       The number of direct ancestors this column has.  A column with a 
d1008 1
a1008 1
   <structfield>atttypid</structfield> is reset to zero, but 
d1121 1
a1121 1
       For roles that can log in, this sets maximum number of concurrent 
d2172 1
a2172 1
       Sets maximum number of concurrent connections that can be made 
d4858 1
a4858 1
   types.  Base types (scalar types) are created with
d4929 1
a4929 2
       length would allow pass-by-value; this is currently true for
       type <type>float4</type>, for example
d4950 22
d5241 80
d5891 1
a5891 1
   terminates and releases its locks. 
d6140 1
a6140 1
   readable view of 
d6225 1
a6225 1
       For roles that can log in, this sets maximum number of concurrent 
d6420 1
a6420 1
  
d6878 1
a6878 1
   readable view of 
@


2.170
log
@Add a "provariadic" column to pg_proc to eliminate the remarkably expensive
need to deconstruct proargmodes for each pg_proc entry inspected by
FuncnameGetCandidates().  Fixes function lookup performance regression
caused by yesterday's variadic-functions patch.

In passing, make pg_proc.probin be NULL, rather than a dummy value '-',
in cases where it is not actually used for the particular type of function.
This should buy back some of the space cost of the extra column.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.169 2008/07/16 01:30:21 tgl Exp $ -->
d3683 2
a3684 1
        <literal>v</literal> for <literal>VARIADIC</> arguments.
@


2.169
log
@Support "variadic" functions, which can accept a variable number of arguments
so long as all the trailing arguments are of the same (non-array) type.
The function receives them as a single array argument (which is why they
have to all be the same type).

It might be useful to extend this facility to aggregates, but this patch
doesn't do that.

This patch imposes a noticeable slowdown on function lookup --- a follow-on
patch will fix that by adding a redundant column to pg_proc.

Pavel Stehule
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.168 2008/07/14 00:51:45 tgl Exp $ -->
d3573 8
@


2.168
log
@Create a type-specific typanalyze routine for tsvector, which collects stats
on the most common individual lexemes in place of the mostly-useless default
behavior of counting duplicate tsvectors.  Future work: create selectivity
estimation functions that actually do something with these stats.

(Some other things we ought to look at doing: using the Lossy Counting
algorithm in compute_minimal_stats, and using the element-counting idea for
stats on regular arrays.)

Jan Urbanski
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.167 2008/07/11 07:02:43 petere Exp $ -->
d3646 2
a3647 1
       only input arguments (including <literal>INOUT</literal> arguments), and thus represents
d3658 3
a3660 2
       all arguments (including <literal>OUT</literal> and <literal>INOUT</literal> arguments); however, if all the
       arguments are IN arguments, this field will be null.
d3674 4
a3677 2
        <literal>b</literal> for <literal>INOUT</> arguments.
        If all the arguments are <literal>IN</literal> arguments, this field will be null.
@


2.167
log
@Allow binary-coercible types for cast function arguments and return types.
Document return type of cast functions.

Also change documentation to prefer the term "binary coercible" in its
present sense instead of the previous term "binary compatible".
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.166 2008/05/09 23:32:03 tgl Exp $ -->
d6519 2
d6529 1
a6529 1
       A list of the frequencies of the most common values,
d6532 1
a6532 1
     </entry>
@


2.166
log
@Change the rules for inherited CHECK constraints to be essentially the same
as those for inherited columns; that is, it's no longer allowed for a child
table to not have a check constraint matching one that exists on a parent.
This satisfies the principle of least surprise (rows selected from the parent
will always appear to meet its check constraints) and eliminates some
longstanding bogosity in pg_dump, which formerly had to guess about whether
check constraints were really inherited or not.

The implementation involves adding conislocal and coninhcount columns to
pg_constraint (paralleling attislocal and attinhcount in pg_attribute)
and refactoring various ALTER TABLE actions to be more like those for
columns.

Alex Hunsaker, Nikhil Sontakke, Tom Lane
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.165 2008/04/14 17:05:32 tgl Exp $ -->
d1443 1
a1443 1
       stored if the data types are binary compatible (that is, no
@


2.165
log
@Push index operator lossiness determination down to GIST/GIN opclass
"consistent" functions, and remove pg_amop.opreqcheck, as per recent
discussion.  The main immediate benefit of this is that we no longer need
8.3's ugly hack of requiring @@@@@@ rather than @@@@ to test weight-using tsquery
searches on GIN indexes.  In future it should be possible to optimize some
other queries better than is done now, by detecting at runtime whether the
index match is exact or not.

Tom Lane, after an idea of Heikki's, and with some help from Teodor.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.164 2008/04/10 22:25:25 tgl Exp $ -->
d1911 20
@


2.164
log
@Replace "amgetmulti" AM functions with "amgetbitmap", in which the whole
indexscan always occurs in one call, and the results are returned in a
TIDBitmap instead of a limited-size array of TIDs.  This should improve
speed a little by reducing AM entry/exit overhead, and it is necessary
infrastructure if we are ever to support bitmap indexes.

In an only slightly related change, add support for TIDBitmaps to preserve
(somewhat lossily) the knowledge that particular TIDs reported by an index
need to have their quals rechecked when the heap is visited.  This facility
is not really used yet; we'll need to extend the forced-recheck feature to
plain indexscans before it's useful, and that hasn't been coded yet.
The intent is to use it to clean up 8.3's horrid @@@@@@ kluge for text search
with weighted queries.  There might be other uses in future, but that one
alone is sufficient reason.

Heikki Linnakangas, with some adjustments by me.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.163 2008/03/10 12:55:13 mha Exp $ -->
a609 7
      <entry><structfield>amopreqcheck</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Index hit must be rechecked</entry>
     </row>

     <row>
@


2.163
log
@Implement enum type for guc parameters, and convert a couple of existing
variables to it. More need to be converted, but I wanted to get this in
before it conflicts with too much...

Other than just centralising the text-to-int conversion for parameters,
this allows the pg_settings view to contain a list of available options
and allows an error hint to show what values are allowed.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.162 2008/03/06 18:49:32 momjian Exp $ -->
d476 1
a476 1
      <entry><structfield>amgetmulti</structfield></entry>
d479 1
a479 1
      <entry><quote>Fetch multiple tuples</quote> function</entry>
@


2.162
log
@Document use of pg_locks.objid for advisory locks, suggestion from Marc Mamin
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.161 2008/01/31 18:40:02 tgl Exp $ -->
d6263 2
a6264 2
      <entry>Parameter type (<literal>bool</>, <literal>integer</>,
       <literal>real</>, or <literal>string</>)
d6284 6
@


2.161
log
@Improve pg_autovacuum documentation to clarify that the enabled field cannot
prevent anti-wraparound vacuuming, and to caution against setting unreasonably
small values of freeze_max_age.  Also put in a notice that this catalog is
likely to disappear entirely in some future release.  Per discussion of
bug #3898 from Steven Flatt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.160 2008/01/29 13:03:50 petere Exp $ -->
d5694 4
a5697 1
       object is not a general database object
@


2.160
log
@markup correct

from Gevik Babakhani
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.159 2007/10/01 21:10:40 tgl Exp $ -->
d1248 8
d1281 2
a1282 1
      <entry>If false, this table is never autovacuumed</entry>
d1364 3
a1366 1
   has been changed or not.  The system will launch autovacuum to perform
d1378 2
a1379 2
   or from <xref linkend="guc-vacuum-cost-delay"> if the former is set to a negative
   value.  The same applies to <structfield>vac_cost_limit</>.
d1381 6
a1386 3
   <structfield>freeze_max_age</> larger than the system-wide setting (it can only be set
   smaller), and the <structfield>freeze_min_age value</> will be limited to half the
   system-wide <xref linkend="guc-autovacuum-freeze-max-age"> setting.
@


2.159
log
@Add catalogs.sgml documentation for text search catalogs.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.158 2007/09/20 17:56:30 tgl Exp $ -->
d1403 1
a1403 1
   <title><structfield>pg_cast</> Columns</title>
@


2.158
log
@HOT updates.  When we update a tuple without changing any of its indexed
columns, and the new version can be stored on the same heap page, we no longer
generate extra index entries for the new version.  Instead, index searches
follow the HOT-chain links to ensure they find the correct tuple version.

In addition, this patch introduces the ability to "prune" dead tuples on a
per-page basis, without having to do a complete VACUUM pass to recover space.
VACUUM is still needed to clean up dead index entries, however.

Pavan Deolasee, with help from a bunch of other people.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.157 2007/09/05 18:10:47 tgl Exp $ -->
d222 25
d2509 1
d3298 1
a3298 1
   <quote>compatible</>, in a way that depends on the access method.
d4433 376
@


2.157
log
@Implement lazy XID allocation: transactions that do not modify any database
rows will normally never obtain an XID at all.  We already did things this way
for subtransactions, but this patch extends the concept to top-level
transactions.  In applications where there are lots of short read-only
transactions, this should improve performance noticeably; not so much from
removal of the actual XID-assignments, as from reduction of overhead that's
driven by the rate of XID consumption.  We add a concept of a "virtual
transaction ID" so that active transactions can be uniquely identified even
if they don't have a regular XID.  This is a much lighter-weight concept:
uniqueness of VXIDs is only guaranteed over the short term, and no on-disk
record is made about them.

Florian Pflug, with some editorialization by Tom.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.156 2007/09/03 00:39:11 tgl Exp $ -->
d2569 23
@


2.156
log
@Implement function-local GUC parameter settings, as per recent discussion.
There are still some loose ends: I didn't do anything about the SET FROM
CURRENT idea yet, and it's not real clear whether we are happy with the
interaction of SET LOCAL with function-local settings.  The documentation
is a bit spartan, too.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.155 2007/06/20 19:24:05 neilc Exp $ -->
d5150 1
a5150 1
   transaction IDs,
d5181 1
d5224 9
d5270 2
a5271 2
      <entry><structfield>transaction</structfield></entry>
      <entry><type>xid</type></entry>
d5274 1
a5274 1
       ID of the transaction that is holding or awaiting this lock
d5314 5
a5318 2
   Every transaction holds an exclusive lock on its transaction ID for its
   entire duration. If one transaction finds it necessary to wait specifically
d5320 2
a5321 1
   the other transaction ID. That will succeed only when the other transaction
d5331 1
a5331 1
   transaction ID of the current holder of that row lock.
d5367 1
a5367 2
   If you have enabled the statistics collector, the
   <structfield>pid</structfield> column can be joined to the
d5370 1
a5370 1
   information on the session holding or waiting to hold the lock.
@


2.155
log
@Remove some empty columns from a few system catalog tables in the
SGML docs.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.154 2007/06/08 21:09:49 alvherre Exp $ -->
d3639 7
@


2.154
log
@Avoid passing zero as a value for vacuum_cost_limit, because it's not a valid
value for the vacuum code.  Instead, make zero signify getting the value from a
higher level configuration facility, just like -1 in the original coding.  We
still document that -1 is the value that disables the feature, to avoid
confusing the user unnecessarily.

Reported by Galy Lee in <200705310914.l4V9E6JA094603@@wwwmaster.postgresql.org>;
per subsequent discussion.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.153 2007/06/05 21:31:03 tgl Exp $ -->
d1040 1
a1040 1
   <tgroup cols=4>
d2819 1
a2819 1
   <tgroup cols=4>
d4931 1
a4931 1
   <tgroup cols=4>
d5388 1
a5388 1
   <tgroup cols=4>
d5754 1
a5754 1
   <tgroup cols=4>
d6289 1
a6289 1
   <tgroup cols=4>
@


2.153
log
@Downgrade implicit casts to text to be assignment-only, except for the ones
from the other string-category types; this eliminates a lot of surprising
interpretations that the parser could formerly make when there was no directly
applicable operator.

Create a general mechanism that supports casts to and from the standard string
types (text,varchar,bpchar) for *every* datatype, by invoking the datatype's
I/O functions.  These new casts are assignment-only in the to-string direction,
explicit-only in the other, and therefore should create no surprising behavior.
Remove a bunch of thereby-obsoleted datatype-specific casting functions.

The "general mechanism" is a new expression node type CoerceViaIO that can
actually convert between *any* two datatypes if their external text
representations are compatible.  This is more general than needed for the
immediate feature, but might be useful in plpgsql or other places in future.

This commit does nothing about the issue that applying the concatenation
operator || to non-text types will now fail, often with strange error messages
due to misinterpreting the operator as array concatenation.  Since it often
(not always) worked before, we should either make it succeed or at least give
a more user-friendly error; but details are still under debate.

Peter Eisentraut and Tom Lane
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.152 2007/05/15 19:13:54 neilc Exp $ -->
d1342 1
a1342 1
   or from <varname>vacuum_cost_delay</> if the former is set to a negative
@


2.152
log
@Various fixes for the SGML docs. Consistently use spaces before/after
parentheses in syntax descriptions. Consistently use the present tense
when describing the basic purpose of each "DROP" command. Add a few
more hyperlinks.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.151 2007/05/11 17:57:11 tgl Exp $ -->
d1361 2
a1362 2
   The catalog <structname>pg_cast</structname> stores data type conversion paths,
   both built-in paths and those defined with
d1366 11
@


2.151
log
@Support arrays of composite types, including the rowtypes of regular tables
and views (but not system catalogs, nor sequences or toast tables).  Get rid
of the hardwired convention that a type's array type is named exactly "_type",
instead using a new column pg_type.typarray to provide the linkage.  (It still
will be named "_type", though, except in odd corner cases such as
maximum-length type names.)

Along the way, make tracking of owner and schema dependencies for types more
uniform: a type directly created by the user has these dependencies, while a
table rowtype or auto-generated array type does not have them, but depends on
its parent object instead.

David Fetter, Andrew Dunstan, Tom Lane
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.150 2007/04/06 22:33:41 tgl Exp $ -->
d3987 7
a3993 6
   The catalog <structname>pg_statistic</structname> stores statistical data
   about the contents of the database.  Entries are created by
   <command>ANALYZE</command> and subsequently used by the query planner.
   There is one entry for each table column that has been analyzed.
   Note that all the statistical data is inherently approximate,
   even assuming that it is up-to-date.
@


2.150
log
@Make 'col IS NULL' clauses be indexable conditions.

Teodor Sigaev, with some kibitzing from Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.149 2007/04/02 03:49:36 tgl Exp $ -->
d4528 11
d4700 4
a4703 3
       for a domain that is an array (that is, <structfield>typbasetype</> is an array type;
       the domain's <structfield>typelem</> will match the base type's <structfield>typelem</structfield>).
       Zero for types other than array domains
@


2.149
log
@Support enum data types.  Along the way, use macros for the values of
pg_type.typtype whereever practical.  Tom Dunstan, with some kibitzing
from Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.148 2007/03/26 16:58:37 tgl Exp $ -->
d409 7
@


2.148
log
@Allow non-superuser database owners to create procedural languages.
A DBA is allowed to create a language in his database if it's marked
"tmpldbacreate" in pg_pltemplate.  The factory default is that this is set
for all standard trusted languages, but of course a superuser may adjust
the settings.  In service of this, add the long-foreseen owner column to
pg_language; renaming, dropping, and altering owner of a PL now follow
normal ownership rules instead of being superuser-only.
Jeremy Drake, with some editorialization by Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.147 2007/03/22 15:46:56 momjian Exp $ -->
d132 5
d1433 1
a1433 5
   to be legal for a particular type modifier value.  Note however that
   at present there is no support for associating non-default type
   modifiers with user-created data types, and so this facility is only
   of use for the small number of built-in types that have type modifier
   syntax built into the grammar.
d2417 49
d4448 7
a4454 5
       <structfield>typtype</structfield> is <literal>b</literal> for
       a base type, <literal>c</literal> for a composite type (e.g., a
       table's row type), <literal>d</literal> for a domain, or
       <literal>p</literal> for a pseudo-type.  See also
       <structfield>typrelid</structfield> and
@


2.147
log
@Remove tabs in SGML files.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.146 2007/03/19 23:38:28 wieck Exp $ -->
d2659 7
d3275 1
a3275 1
   <tgroup cols=4>
d3298 6
@


2.146
log
@Changes pg_trigger and extend pg_rewrite in order to allow triggers and
rules to be defined with different, per session controllable, behaviors
for replication purposes.

This will allow replication systems like Slony-I and, as has been stated
on pgsql-hackers, other products to control the firing mechanism of
triggers and rewrite rules without modifying the system catalog directly.

The firing mechanisms are controlled by a new superuser-only GUC
variable, session_replication_role, together with a change to
pg_trigger.tgenabled and a new column pg_rewrite.ev_enabled. Both
columns are a single char data type now (tgenabled was a bool before).
The possible values in these attributes are:

     'O' - Trigger/Rule fires when session_replication_role is "origin"
           (default) or "local". This is the default behavior.

     'D' - Trigger/Rule is disabled and fires never

     'A' - Trigger/Rule fires always regardless of the setting of
           session_replication_role

     'R' - Trigger/Rule fires when session_replication_role is "replica"

The GUC variable can only be changed as long as the system does not have
any cached query plans. This will prevent changing the session role and
accidentally executing stored procedures or functions that have plans
cached that expand to the wrong query set due to differences in the rule
firing semantics.

The SQL syntax for changing a triggers/rules firing semantics is

     ALTER TABLE <tabname> <when> TRIGGER|RULE <name>;

     <when> ::= ENABLE | ENABLE ALWAYS | ENABLE REPLICA | DISABLE

psql's \d command as well as pg_dump are extended in a backward
compatible fashion.

Jan
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.145 2007/02/14 01:58:55 tgl Exp $ -->
d3647 7
a3653 7
	   Controls in which <xref linkend="guc-session-replication-role"> modes
	   the rule fires.
	   <literal>O</> = rule fires in <quote>origin</> and <quote>local</> modes,
	   <literal>D</> = rule is disabled,
	   <literal>R</> = rule fires in <quote>replica</> mode,
	   <literal>A</> = rule fires always.
	  </entry>
d4198 7
a4204 7
	   Controls in which <xref linkend="guc-session-replication-role"> modes
	   the trigger fires.
	   <literal>O</> = trigger fires in <quote>origin</> and <quote>local</> modes,
	   <literal>D</> = trigger is disabled,
	   <literal>R</> = trigger fires in <quote>replica</> mode,
	   <literal>A</> = trigger fires always.
	  </entry>
@


2.145
log
@Fix up foreign-key mechanism so that there is a sound semantic basis for the
equality checks it applies, instead of a random dependence on whatever
operators might be named "=".  The equality operators will now be selected
from the opfamily of the unique index that the FK constraint depends on to
enforce uniqueness of the referenced columns; therefore they are certain to be
consistent with that index's notion of equality.  Among other things this
should fix the problem noted awhile back that pg_dump may fail for foreign-key
constraints on user-defined types when the required operators aren't in the
search path.  This also means that the former warning condition about "foreign
key constraint will require costly sequential scans" is gone: if the
comparison condition isn't indexable then we'll reject the constraint
entirely. All per past discussions.

Along the way, make the RI triggers look into pg_constraint for their
information, instead of using pg_trigger.tgargs; and get rid of the always
error-prone fixed-size string buffers in ri_triggers.c in favor of building up
the RI queries in StringInfo buffers.

initdb forced due to columns added to pg_constraint and pg_trigger.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.144 2007/01/31 20:56:16 momjian Exp $ -->
d3643 14
d4195 1
a4195 1
      <entry><type>bool</type></entry>
d4197 8
a4204 1
      <entry>True if trigger is enabled</entry>
@


2.144
log
@Update documentation on may/can/might:

Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".

Also update two error messages mentioned in the documenation to match.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.143 2007/01/22 01:35:19 tgl Exp $ -->
d1874 21
d1923 2
a1924 2
    number of check-constraint entries found in this table for the
    given relation.
d4190 1
a4190 1
      <entry>True if trigger implements a referential integrity constraint</entry>
d4197 1
a4197 1
      <entry>Referential integrity constraint name</entry>
d4204 8
a4211 1
      <entry>The table referenced by an referential integrity constraint</entry>
d4218 1
a4218 1
      <entry>True if deferrable</entry>
d4225 1
a4225 1
      <entry>True if initially deferred</entry>
d4254 12
d4267 1
a4267 1
    number of triggers found in this table for the given relation.
@


2.143
log
@Add COST and ROWS options to CREATE/ALTER FUNCTION, plus underlying pg_proc
columns procost and prorows, to allow simple user adjustment of the estimated
cost of a function call, as well as control of the estimated number of rows
returned by a set-returning function.  We might eventually wish to extend this
to allow function-specific estimation routines, but there seems to be
consensus that we should try a simple constant estimate first.  In particular
this provides a relatively simple way to control the order in which different
WHERE clauses are applied in a plan node, which is a Good Thing in view of the
fact that the recent EquivalenceClass planner rewrite made that much less
predictable than before.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.142 2007/01/20 23:13:01 tgl Exp $ -->
d526 1
a526 1
   can appear in more than one family, but may not appear in more than one
d873 1
a873 1
       in memory this may be updated to cache the offset of the attribute
d957 1
a957 1
       This column is defined locally in the relation.  Note that a column may
d1001 1
a1001 1
   without <structfield>rolcanlogin</>) may have other roles as members; see
d1060 1
a1060 1
      <entry>Role may create more roles</entry>
d1066 1
a1066 1
      <entry>Role may create databases</entry>
d1073 1
a1073 1
       Role may update system catalogs directly.  (Even a superuser may not do
d1082 1
a1082 1
       Role may log in. That is, this role can be given as the initial
d1180 1
a1180 1
      <entry>True if <structfield>member</> may grant membership in
d1398 1
a1398 1
       Indicates what contexts the cast may be invoked in.
d2248 1
a2248 1
   referenced object may not be dropped without also dropping the dependent
d2258 2
a2259 2
       dependent object may be dropped without affecting the
       referenced object.  The referenced object may only be dropped
d2314 1
a2314 1
   Other dependency flavors may be needed in future.
d2645 1
a2645 1
       to determine which languages need to be dumped, but this may be
d2657 1
a2657 1
       environment.  Only superusers may create functions in untrusted
d2751 1
a2751 1
       This will never be more than <symbol>LOBLKSIZE</> bytes and may be less
d2762 1
a2762 1
   allows sparse storage: pages may be missing, and may be shorter than
d3442 1
a3442 1
       whose results may change at any time.  (Use <literal>v</literal> also
d3757 1
a3757 1
   the referenced object may not be dropped without also dropping the dependent
d3799 1
a3799 1
   Other dependency flavors may be needed in future.  Note in particular
d3900 1
a3900 1
   Since different kinds of statistics may be appropriate for different
d3914 1
a3914 1
   may be considered sensitive.  (Example: minimum and maximum values
d4584 1
a4584 1
       the type's default value, which may be fed to the type's input
d4765 1
a4765 1
     Therefore, the <structname>pg_cursors</> view may include cursors
d4976 1
a4976 1
   lockable object may
d5444 1
a5444 1
      <entry>Role may create more roles</entry>
d5451 1
a5451 1
      <entry>Role may create databases</entry>
d5459 1
a5459 1
       Role may update system catalogs directly.  (Even a superuser may not do
d5469 1
a5469 1
       Role may log in. That is, this role can be given as the initial
d5740 1
a5740 1
      <entry>User may create databases</entry>
d5755 1
a5755 1
       User may update system catalogs.  (Even a superuser may not do
d6156 1
a6156 1
      <entry>User may create databases</entry>
d6169 1
a6169 1
       User may update system catalogs.  (Even a superuser may not do
@


2.142
log
@Simplify pg_am representation of ordering-capable access methods:
provide just a boolean 'amcanorder', instead of fields that specify the
sort operator strategy numbers.  We have decided to require ordering-capable
AMs to use btree-compatible strategy numbers, so the old fields are
overkill (and indeed misleading about what's allowed).
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.141 2007/01/09 02:14:09 tgl Exp $ -->
d3379 16
@


2.141
log
@Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST
per-column options for btree indexes.  The planner's support for this is still
pretty rudimentary; it does not yet know how to plan mergejoins with
nondefault ordering options.  The documentation is pretty rudimentary, too.
I'll work on improving that stuff later.

Note incompatible change from prior behavior: ORDER BY ... USING will now be
rejected if the operator is not a less-than or greater-than member of some
btree opclass.  This prevents less-than-sane behavior if an operator that
doesn't actually define a proper sort ordering is selected.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.140 2006/12/30 21:21:52 tgl Exp $ -->
d368 2
a369 11
      <entry><structfield>amorderstrategy</structfield></entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>Zero if the index offers no sort order, otherwise the strategy
      number of the strategy operator that describes the default
      (<literal>ASC</>) sort order</entry>
     </row>

     <row>
      <entry><structfield>amdescorder</structfield></entry>
      <entry><type>int2</type></entry>
d371 1
a371 3
      <entry>Zero if the index offers no sort order, otherwise the strategy
      number of the strategy operator that describes the <literal>DESC</>
      sort order</entry>
@


2.140
log
@Support type modifiers for user-defined types, and pull most knowledge
about typmod representation for standard types out into type-specific
typmod I/O functions.  Teodor Sigaev, with some editorialization by
Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.139 2006/12/23 00:43:08 tgl Exp $ -->
d372 11
a382 1
      number of the strategy operator that describes the sort order</entry>
d2466 2
a2467 2
      <entry>If true, this index represents the primary key of the table.
      (<structfield>indisunique</> should always be true when this is true.)</entry>
d2500 1
a2500 1
       rather than a simple column reference.
d2509 1
a2509 1
       For each column in the index key this contains the OID of
d2516 11
@


2.139
log
@Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.138 2006/12/18 18:56:28 tgl Exp $ -->
d4397 14
@


2.138
log
@Set pg_am.amstrategies to zero for index AMs that don't have fixed
operator strategy numbers, ie, GiST and GIN.  This is almost cosmetic
enough to not need a catversion bump, but since the opr_sanity regression
test has to change in sync with the catalog entry, I figured I'd better
do one.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.137 2006/11/12 06:25:37 neilc Exp $ -->
d163 1
a163 1
      <entry>index access method operator classes</entry>
d172 5
d524 5
a528 3
   The catalog <structname>pg_amop</structname> stores information about operators
   associated with index access method operator classes.  There is one
   row for each operator that is a member of an operator class.
d546 8
a553 1
      <entry><structfield>amopclaid</structfield></entry>
d555 2
a556 2
      <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
      <entry>The index operator class this entry is for</entry>
d560 1
a560 1
      <entry><structfield>amopsubtype</structfield></entry>
d563 1
a563 2
      <entry>Subtype to distinguish multiple entries for one strategy;
             zero for default</entry>
d587 7
d598 10
d619 3
a621 4
   The catalog <structname>pg_amproc</structname> stores information about support
   procedures
   associated with index access method operator classes.  There is one
   row for each support procedure belonging to an operator class.
d639 1
a639 1
      <entry><structfield>amopclaid</structfield></entry>
d641 9
a649 2
      <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
      <entry>The index operator class this entry is for</entry>
d653 1
a653 1
      <entry><structfield>amprocsubtype</structfield></entry>
d656 1
a656 1
      <entry>Subtype, if cross-type routine, else zero</entry>
d677 12
d2894 5
a2898 3
   index access method.  Note that there can be multiple operator classes
   for a given data type/access method combination, thus supporting multiple
   behaviors.
d2920 1
a2920 1
      <entry><structfield>opcamid</structfield></entry>
d2948 7
d2980 5
a2984 8
   The majority of the information defining an operator class is actually
   not in its <structname>pg_opclass</structname> row, but in the associated
   rows in <structname>pg_amop</structname> and
   <structname>pg_amproc</structname>.  Those rows are considered to be
   part of the operator class definition &mdash; this is not unlike the way
   that a relation is defined by a single <structname>pg_class</structname>
   row plus associated rows in <structname>pg_attribute</structname> and
   other tables.
d3051 7
a3099 40
      <entry><structfield>oprlsortop</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>
       If this operator supports merge joins, the operator that sorts
       the type of the left-hand operand (<literal>L&lt;L</>)
      </entry>
     </row>

     <row>
      <entry><structfield>oprrsortop</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>
       If this operator supports merge joins, the operator that sorts
       the type of the right-hand operand (<literal>R&lt;R</>)
      </entry>
     </row>

     <row>
      <entry><structfield>oprltcmpop</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>
       If this operator supports merge joins, the less-than operator that
       compares the left and right operand types (<literal>L&lt;R</>)
      </entry>
     </row>

     <row>
      <entry><structfield>oprgtcmpop</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
      <entry>
       If this operator supports merge joins, the greater-than operator that
       compares the left and right operand types (<literal>L&gt;R</>)
      </entry>
     </row>

     <row>
d3131 80
@


2.137
log
@Do a round of copy-editing for the system catalog chapter. In particular,
consistently capitalize the content of the "Description" column but do
not include a terminating period, as is the convention elsewhere in the
docs. Also, remove the "References" column from catalog that do not
have any referencing columns, for the sake of brevity. Make various
other SGML and grammar fixes.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.136 2006/11/05 22:42:06 tgl Exp $ -->
d350 3
a352 1
      <entry>Number of operator strategies for this access method</entry>
@


2.137.2.1
log
@Improve pg_autovacuum documentation to clarify that the enabled field cannot
prevent anti-wraparound vacuuming, and to caution against setting unreasonably
small values of freeze_max_age.  Also put in a notice that this catalog is
likely to disappear entirely in some future release.  Per discussion of
bug #3898 from Steven Flatt.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.137 2006/11/12 06:25:37 neilc Exp $ -->
a1161 8
  <note>
   <para>
    It is likely that <structname>pg_autovacuum</structname> will disappear
    in a future release, with the information instead being kept in
    <structname>pg_class</>.<structfield>reloptions</> entries.
   </para>
  </note>

d1187 1
a1187 2
      <entry>If false, this table will not be autovacuumed, except
       to prevent transaction ID wraparound</entry>
d1269 1
a1269 3
   has been changed or not, even if
   <structname>pg_autovacuum</>.<structfield>enabled</> is set to
   <literal>false</> for it.  The system will launch autovacuum to perform
d1281 2
a1282 2
   or from <xref linkend="guc-vacuum-cost-delay"> if the former is set to a
   negative value.  The same applies to <structfield>vac_cost_limit</>.
d1284 3
a1286 6
   <structfield>freeze_max_age</> larger than the system-wide setting (it can
   only be set smaller), and the <structfield>freeze_min_age</> value will be
   limited to half the system-wide <xref
   linkend="guc-autovacuum-freeze-max-age"> setting.  Note that while you
   can set <structfield>freeze_max_age</> very small, or even zero, this
   is usually unwise since it will force frequent vacuuming.
@


2.136
log
@Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios.  We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases.  Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId.  Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done.  Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database.  initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.135 2006/10/23 18:10:30 petere Exp $ -->
d293 1
a293 1
       value starts out NULL.
d782 1
a782 1
       to collect, and the target number of histogram bins to create.
d803 1
a803 1
       have (arbitrary) negative numbers.
d814 1
a814 1
       so any nonzero value effectively means <quote>it's an array</>.)
d825 1
a825 1
       within the row.
d838 1
a838 1
       The value will generally be -1 for types that do not need <structfield>atttypmod</>.
d858 1
a858 1
       after column creation to control storage policy.
d877 1
a877 1
       change this column to enable or disable the constraint.
d888 1
a888 1
       catalog that actually defines the value.
d899 1
a899 1
       ignored by the parser and so cannot be accessed via SQL.
d909 1
a909 1
       be locally defined and inherited simultaneously.
d919 1
a919 1
       nonzero number of ancestors cannot be dropped nor renamed.
a983 1
      <entry>References</entry>
a991 1
      <entry></entry>
a997 1
      <entry></entry>
a1003 1
      <entry></entry>
a1010 1
      <entry></entry>
a1016 1
      <entry></entry>
a1022 1
      <entry></entry>
d1025 1
a1025 1
       this unless this column is true.)
a1031 1
      <entry></entry>
d1034 1
a1034 1
       session authorization identifier.
a1040 1
      <entry></entry>
d1043 1
a1043 1
       connections this role can make.  -1 means no limit.
a1049 1
      <entry></entry>
a1055 1
      <entry></entry>
a1062 1
      <entry></entry>
d1155 1
a1155 1
   per-relation configuration parameters for <xref linkend="autovacuum" endterm="autovacuum-title">.
d1158 2
a1159 1
   is present, the system-wide defaults will be used.
d1280 1
a1280 1
   <varname>autovacuum_vacuum_cost_delay</> configuration parameter,
d1284 3
a1286 3
   freeze_max_age larger than the system-wide setting (it can only be set
   smaller), and the freeze_min_age value will be limited to half the
   system-wide <varname>autovacuum_freeze_max_age</> setting.
d1301 2
a1302 1
   both built-in paths and those defined with <command>CREATE CAST</command>.
d1340 1
a1340 1
       run-time operation is needed to perform the cast).
d1355 1
a1355 1
       other cases.
d1492 4
a1495 5
       <symbol>BLCKSZ</symbol>).
       This is only an estimate used by the planner.
       It is updated by <command>VACUUM</command>,
       <command>ANALYZE</command>, and a few DDL commands
       such as <command>CREATE INDEX</command>.
d1504 4
a1507 5
       Number of rows in the table.
       This is only an estimate used by the planner.
       It is updated by <command>VACUUM</command>,
       <command>ANALYZE</command>, and a few DDL commands
       such as <command>CREATE INDEX</command>.
d1516 3
a1518 3
       OID of the TOAST table associated with this table, 0 if none.
       The TOAST table stores large attributes <quote>out of
       line</quote> in a secondary table.
d1527 1
a1527 1
       For a TOAST table, the OID of its index.  0 if not a TOAST table.
d1540 1
a1540 1
       table has no indexes.
d1548 5
a1552 3
      <entry>True if this table is shared across all databases in the
      cluster.  Only certain system catalogs (such as
      <structname>pg_database</structname>) are shared.</entry>
d1575 1
a1575 1
       <literal>pg_attribute.attnum</literal>.
d1585 1
a1585 1
       <structname>pg_constraint</structname> catalog
d1595 1
a1595 1
       <structname>pg_trigger</structname> catalog
d1642 3
a1644 2
      <entry>True if table has rules; see
       <structname>pg_rewrite</structname> catalog
d1664 1
a1664 1
       (<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
d1953 5
a1957 5
   The catalog <structname>pg_database</structname> stores information
   about the available databases.  Databases are created with the
   <command>CREATE DATABASE</command> command.  Consult
   <xref linkend="managing-databases"> for details about the meaning of some of the
   parameters.
d2012 1
a2012 1
       this one.
d2022 1
a2022 1
       used to protect the <literal>template0</> database from being altered.
d2032 1
a2032 1
       to this database.  -1 means no limit.
d2056 1
a2056 1
       <structname>pg_class</>.<structfield>relfrozenxid</> values.
d2069 1
a2069 1
       system catalogs will be there.
d2154 1
a2154 1
       zero.
d2180 1
a2180 1
       is zero.
d2281 1
a2281 1
   with the <command>COMMENT</command> command and viewed with
d2329 1
a2329 1
       zero.
d2421 7
a2427 5
      <entry>If true, the index is currently valid for queries.
       False means the index is possibly incomplete: it must still be
       inserted into by INSERT/UPDATE operations, but it cannot safely be
       used for queries, and if it is unique, the uniqueness shouldn't be
       relied on either.</entry>
d2451 1
a2451 1
       <structname>pg_opclass</structname> for details.
d2462 1
a2462 1
      NULL if all index attributes are simple references.</entry>
d2470 1
a2470 1
      for partial index predicate.  NULL if not a partial index.</entry>
d2532 1
a2532 1
       inherited columns are to be arranged.  The count starts at 1.
d2586 1
a2586 1
       replaced by a different mechanism sometime.
d2598 1
a2598 1
       languages.
d2610 1
a2610 1
       language.
d2621 1
a2621 1
       are created.  Zero if no validator is provided.
d2656 1
a2656 1
   The amount of data per page is defined to be <literal>LOBLKSIZE</> (which is currently
a2667 1
      <entry>References</entry>
a2675 1
      <entry></entry>
a2681 1
      <entry></entry>
a2688 1
      <entry></entry>
d2691 1
a2691 1
       This will never be more than <symbol>LOBLKSIZE</> bytes and may be less.
d2746 3
a2748 3
      <entry></entry>
      <entry>Notify condition name.  (The name need not match any actual
      relation in the database; the name <structfield>relname</> is historical.)
a2754 1
      <entry></entry>
a2760 1
      <entry></entry>
d2763 1
a2763 1
       pending, the PID of the server process that sent the notification.
a3138 1
      <entry>References</entry>
a3146 1
      <entry></entry>
a3152 1
      <entry></entry>
a3158 1
      <entry></entry>
a3164 1
      <entry></entry>
a3170 1
      <entry></entry>
a3176 1
      <entry></entry>
d3288 1
a3288 1
       null inputs.
d3340 1
a3340 1
       the call signature of the function.
d3353 1
a3353 1
       <structfield>proargtypes</> is subscripted from 0.
d3368 1
a3368 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
d3381 1
a3381 1
        <structfield>proallargtypes</> not <structfield>proargtypes</>.
d3393 1
a3393 1
       else, depending on the implementation language/call convention.
d3401 3
a3403 2
      <entry>Additional information about how to invoke the function.
      Again, the interpretation is language-specific.
d3685 4
a3688 3
   descriptions (comments) for shared database objects.  Descriptions can
   be manipulated with the <command>COMMENT</command> command and viewed
   with <application>psql</application>'s <literal>\d</literal> commands.
d3736 1
a3736 1
      <entry>Arbitrary text that servers as the description of this object.</entry>
d3844 1
a3844 1
      A zero value means the number of distinct values is unknown.
d3855 1
a3855 1
       <structname>pg_statistic</structname> row.
d3867 1
a3867 1
       that defines the sort order of the data.
d3892 1
a3892 1
       <type>anyarray</>.
d4186 1
a4186 1
       type <type>float4</type>, for example.
d4200 1
a4200 1
       <structfield>typbasetype</structfield>.
d4212 1
a4212 1
       except the type name, namespace, and OID can be relied on.
d4220 5
a4224 3
      <entry>Character that separates two values of this type when parsing
      array input.  Note that the delimiter is associated with the array
      element data type, not the array data type.</entry>
d4239 1
a4239 1
       Zero for non-composite types.
d4261 1
a4261 1
       subroutines.
d4381 1
a4381 1
       constraint on a type.  Used for domains only.
d4390 3
a4392 3
       If this is a domain (see <structfield>typtype</structfield>),
       then <structfield>typbasetype</structfield> identifies
       the type that this one is based on.  Zero if not a domain.
d4403 1
a4403 1
       <literal>typmod</>).  -1 if this type is not a domain.
d4415 1
a4415 1
       Zero for types other than array domains.
d4426 1
a4426 1
       only used for domains.
d4442 1
a4442 1
       converter to produce a constant.
a4635 1
      <entry>References</entry>
a4643 1
      <entry></entry>
a4649 1
      <entry></entry>
a4655 1
      <entry></entry>
a4665 1
      <entry></entry>
a4675 1
      <entry></entry>
a4685 1
      <entry></entry>
d4783 1
a4783 1
      <entry>name of schema containing table and index</entry>
d4789 1
a4789 1
      <entry>name of table the index is for</entry>
d4795 1
a4795 1
      <entry>name of index</entry>
d4801 1
a4801 1
      <entry>name of tablespace containing index (NULL if default for database)</entry>
d4807 2
a4808 1
      <entry>index definition (a reconstructed creation command)</entry>
d4903 1
a4903 1
       page number within the relation, or NULL if the object
d4912 1
a4912 1
       tuple number within the page, or NULL if the object is not a tuple
d4966 1
a4966 1
       lock.  NULL if the lock is held by a prepared transaction.
d4973 1
a4973 1
      <entry>name of the lock mode held or desired by this process (see <xref
d4980 1
a4980 1
      <entry>true if lock is held, false if lock is awaited</entry>
d5032 1
a5032 1
   read often.
a5092 1
      <entry>References</entry>
a5099 1
      <entry></entry>
a5106 1
      <entry></entry>
d5113 1
a5113 1
       statement itself.
a5118 1
      <entry></entry>
a5125 1
      <entry></entry>
d5130 1
a5130 1
       <type>regtype</type> value to <type>oid</type>.
a5135 1
      <entry></entry>
d5236 1
a5236 1
   read often.
d5326 2
a5327 2
       Role may log in, that is, this role can be given as the initial
       session authorization identifier.
d5337 1
a5337 1
       connections this role can make.  -1 means no limit.
d5404 1
a5404 1
      <entry>name of schema containing table</entry>
d5410 1
a5410 1
      <entry>name of table the rule is for</entry>
d5416 1
a5416 1
      <entry>name of rule</entry>
d5422 1
a5422 1
      <entry>rule definition (a reconstructed creation command)</entry>
d5429 2
a5430 2
   The <structname>pg_rules</structname> view excludes the ON SELECT rules of
   views; those can be seen in <structname>pg_views</structname>.
a5458 1
      <entry>References</entry>
d5466 1
a5466 2
      <entry></entry>
      <entry>run-time configuration parameter name</entry>
d5471 1
a5471 2
      <entry></entry>
      <entry>current value of the parameter</entry>
d5476 1
a5476 2
      <entry></entry>
      <entry>implicit unit of the parameter</entry>
d5481 1
a5481 2
      <entry></entry>
      <entry>logical group of the parameter</entry>
d5486 1
a5486 2
      <entry></entry>
      <entry>a brief description of the parameter</entry>
d5491 1
a5491 2
      <entry></entry>
      <entry>additional, more detailed, information about the parameter</entry>
d5496 1
a5496 2
      <entry></entry>
      <entry>context required to set the parameter's value</entry>
d5501 1
a5501 2
      <entry></entry>
      <entry>parameter type (<literal>bool</>, <literal>integer</>,
d5508 1
a5508 2
      <entry></entry>
      <entry>source of the current parameter value</entry>
d5513 1
a5513 2
      <entry></entry>
      <entry>minimum allowed value of the parameter (NULL for nonnumeric
d5519 1
a5519 2
      <entry></entry>
      <entry>maximum allowed value of the parameter (NULL for nonnumeric
d5530 1
a5530 1
   the <xref linkend="SQL-SET" endterm="SQL-SET-title"> command on that named
d5684 1
a5684 1
      <entry>name of schema containing table</entry>
d5691 1
a5691 1
      <entry>name of table</entry>
d5698 1
a5698 1
      <entry>name of the column described by this row</entry>
d5705 1
a5705 1
      <entry>fraction of column entries that are null</entry>
d5712 1
a5712 1
      <entry>average width in bytes of column's entries</entry>
d5719 9
a5727 9
      <entry>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</> 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.
d5735 4
a5738 2
      <entry>A list of the most common values in the column. (NULL if
      no values seem to be more common than any others.)</entry>
d5745 4
a5748 3
      <entry>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.)
d5756 8
a5763 7
      <entry>A list of values that divide the column's values into
      groups of approximately equal population.  The values in
      <structfield>most_common_vals</>, if present, are omitted from this
      histogram calculation.  (This column is NULL if the column data type
      does not have a <literal>&lt;</> operator or if the
      <structfield>most_common_vals</> list accounts for the entire
      population.)
d5771 7
a5777 6
      <entry>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;</> operator.)
d5823 1
a5823 1
      <entry>name of schema containing table</entry>
d5829 1
a5829 1
      <entry>name of table</entry>
d5835 1
a5835 1
      <entry>name of table's owner</entry>
d5841 1
a5841 1
      <entry>name of tablespace containing table (NULL if default for database)</entry>
d5896 1
a5896 1
      <entry>time zone abbreviation</entry>
d5901 1
a5901 1
      <entry>offset from UTC (positive means east of Greenwich)</entry>
d5906 1
a5906 1
      <entry>true if this is a daylight-savings abbreviation</entry>
d5948 1
a5948 1
      <entry>time zone name</entry>
d5953 1
a5953 1
      <entry>time zone abbreviation</entry>
d5958 1
a5958 1
      <entry>offset from UTC (positive means east of Greenwich)</entry>
d5963 1
a5963 1
      <entry>true if currently observing daylight savings</entry>
a5993 1
      <entry>References</entry>
a6000 1
      <entry></entry>
a6006 1
      <entry></entry>
a6012 1
      <entry></entry>
a6018 1
      <entry></entry>
a6024 1
      <entry></entry>
a6033 1
      <entry></entry>
a6039 1
      <entry></entry>
a6045 1
      <entry></entry>
d6083 1
a6083 1
      <entry>name of schema containing view</entry>
d6089 1
a6089 1
      <entry>name of view</entry>
d6095 1
a6095 1
      <entry>name of view's owner</entry>
d6101 1
a6101 1
      <entry>view definition (a reconstructed <command>SELECT</command> query)</entry>
@


2.135
log
@Spellchecking and such
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.134 2006/09/22 23:20:13 tgl Exp $ -->
d1244 14
d1276 11
d1294 4
d1665 1
a1665 1
      <entry><structfield>relminxid</structfield></entry>
d1669 5
a1673 16
       The minimum transaction ID present in all rows in this table.  This
       value is used to determine the database-global
       <structname>pg_database</>.<structfield>datminxid</> value.
      </entry>
     </row>

     <row>
      <entry><structfield>relvacuumxid</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       The transaction ID that was used as cleaning point as of the last vacuum
       operation.  All rows inserted, updated or deleted in this table by
       transactions whose IDs are below this one have been marked as known good
       or deleted.  This is used to determine the database-global
       <structname>pg_database</>.<structfield>datvacuumxid</> value.
d2056 1
a2056 15
      <entry><structfield>datvacuumxid</structfield></entry>
      <entry><type>xid</type></entry>
      <entry></entry>
      <entry>
       The transaction ID that was used as cleaning point as of the last vacuum
       operation.  All rows inserted or deleted by transaction IDs before this one
       have been marked as known good or deleted.  This
       is used to determine when commit-log space can be recycled.
       If <symbol>InvalidTransactionId</symbol>, then the minimum is unknown and can be
       determined by scanning <structname>pg_class</>.<structfield>relvacuumxid</>.
      </entry>
     </row>

     <row>
      <entry><structfield>datminxid</structfield></entry>
d2060 6
a2065 7
       The minimum transaction ID present in all tables in this database.
       All rows inserted by transaction IDs before this one have been
       relabeled with a permanent (<quote>frozen</>) transaction ID in this
       database.  This is useful to check whether a database must be
       vacuumed soon to avoid transaction ID wrap-around problems.
       If <symbol>InvalidTransactionId</symbol>, then the minimum is unknown and can be
       determined by scanning <structname>pg_class</>.<structfield>relminxid</>.
@


2.134
log
@Fix pg_locks view to call advisory locks advisory locks, while preserving
backward compatibility for anyone using the old userlock code that's now
on pgfoundry --- locks from that code still show as 'userlock'.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.133 2006/09/18 22:40:36 tgl Exp $ -->
d408 1
a408 1
      <entry>Can an index of this type be CLUSTERed on?</entry>
d499 1
a499 1
      <entry>Function to parse and validate reloptions for an index</entry>
d1212 1
a1212 1
      <entry>Multiplier for reltuples to add to
d1227 1
a1227 1
      <entry>Multiplier for reltuples to add to
d2046 1
a2046 1
       If InvalidTransactionId, then the minimum is unknown and can be
d2061 1
a2061 1
       If InvalidTransactionId, then the minimum is unknown and can be
d3356 1
a3356 1
       only input arguments (including INOUT arguments), and thus represents
d3367 1
a3367 1
       all arguments (including OUT and INOUT arguments); however, if all the
d3380 4
a3383 4
        <literal>i</literal> for IN arguments,
        <literal>o</literal> for OUT arguments,
        <literal>b</literal> for INOUT arguments.
        If all the arguments are IN arguments, this field will be null.
d5034 1
a5034 1
   bigint value or two integer values.  A bigint key is displayed with its
@


2.133
log
@Add built-in userlock manipulation functions to replace the former
contrib functionality.  Along the way, remove the USER_LOCKS configuration
symbol, since it no longer makes any sense to try to compile that out.
No user documentation yet ... mmoncure has promised to write some.
Thanks to Abhijit Menon-Sen for creating a first draft to work from.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.132 2006/09/16 20:14:32 tgl Exp $ -->
d4893 3
a4895 2
       <literal>object</>, or
       <literal>userlock</>
d5033 1
a5033 1
   User-defined locks can be acquired on keys consisting of either a single
d5040 2
a5041 1
   the keys is up to the user.
@


2.132
log
@Rename the recently-added pg_timezonenames view to pg_timezone_abbrevs,
and create a new view pg_timezone_names that provides information about
the zones known in the 'zic' database.  Magnus Hagander, with some
additional work by Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.131 2006/09/16 00:30:11 momjian Exp $ -->
d5032 8
a5039 3
   If user-defined locks are in use, they are displayed using the columns
   for general database objects.  However, the actual meaning of the lock
   fields in such cases is up to the user.
@


2.131
log
@Remove emacs info from footer of SGML files.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.130 2006/08/25 04:06:44 tgl Exp $ -->
d4567 1
a4567 1
      <entry><link linkend="view-pg-timezonenames"><structname>pg_timezonenames</structname></link></entry>
d4572 5
d5892 2
a5893 2
 <sect1 id="view-pg-timezonenames">
  <title><structname>pg_timezonenames</structname></title>
d5895 2
a5896 2
  <indexterm zone="view-pg-timezonenames">
   <primary>pg_timezonenames</primary>
d5900 1
a5900 1
   The view <structname>pg_timezonenames</structname> provides a list
d5907 53
a5959 1
   <title><structname>pg_timezonenames</> Columns</title>
d5973 5
d5988 1
a5988 1
      <entry>true if this is a daylight-savings zone</entry>
@


2.130
log
@Add the ability to create indexes 'concurrently', that is, without
blocking concurrent writes to the table.  Greg Stark, with a little help
from Tom Lane.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.129 2006/07/31 20:08:55 tgl Exp $ -->
a6081 18

<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-tabs-mode:nil
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/share/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
@


2.129
log
@Change the relation_open protocol so that we obtain lock on a relation
(table or index) before trying to open its relcache entry.  This fixes
race conditions in which someone else commits a change to the relation's
catalog entries while we are in process of doing relcache load.  Problems
of that ilk have been reported sporadically for years, but it was not
really practical to fix until recently --- for instance, the recent
addition of WAL-log support for in-place updates helped.

Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
concurrent update.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.128 2006/07/27 08:30:41 petere Exp $ -->
d2424 11
@


2.128
log
@Allow units to be specified with configuration settings.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.127 2006/07/25 03:51:21 tgl Exp $ -->
a404 7
      <entry><structfield>amconcurrent</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Does the access method support concurrent updates?</entry>
     </row>

     <row>
@


2.127
log
@Remove hard-wired lists of timezone abbreviations in favor of providing
configuration files that can be altered by a DBA.  The australian_timezones
GUC setting disappears, replaced by a timezone_abbreviations setting (set this
to 'Australia' to get the effect of australian_timezones).  The list of zone
names defined by default has undergone a bit of cleanup, too.  Documentation
still needs some work --- in particular, should we fix Table B-4, or just get
rid of it?  Joachim Wieland, with some editorializing by moi.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.126 2006/07/10 16:20:49 alvherre Exp $ -->
d5486 6
@


2.126
log
@Improve vacuum code to track minimum Xids per table instead of per database.
To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,
based on which we calculate the pg_database columns after each vacuum.

We now force all databases to be vacuumed, even template ones.  A backend
noticing too old a database (meaning pg_database.datminxid is in danger of
falling behind Xid wraparound) will signal the postmaster, which in turn will
start an autovacuum iteration to process the offending database.  In principle
this is only there to cope with frozen (non-connectable) databases without
forcing users to set them to connectable, but it could force regular user
database to go through a database-wide vacuum at any time.  Maybe we should
warn users about this somehow.  Of course the real solution will be to use
autovacuum all the time ;-)

There are some additional improvements we could have in this area: for example
the vacuum code could be smarter about not updating pg_database for each table
when called by autovacuum, and do it only once the whole autovacuum iteration
is done.

I updated the system catalogs documentation, but I didn't modify the
maintenance section.  Also having some regression tests for this would be nice
but it's not really a very straightforward thing to do.

Catalog version bumped due to system catalog changes.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.125 2006/07/03 22:45:36 tgl Exp $ -->
d4563 5
d5877 47
@


2.125
log
@Code review for FILLFACTOR patch.  Change WITH grammar as per earlier
discussion (including making def_arg allow reserved words), add missed
opt_definition for UNIQUE case.  Put the reloptions support code in a less
random place (I chose to make a new file access/common/reloptions.c).
Eliminate header inclusion creep.  Make the index options functions safely
user-callable (seems like client apps might like to be able to test validity
of options before trying to make an index).  Reduce overhead for normal case
with no options by allowing rd_options to be NULL.  Fix some unmaintainably
klugy code, including getting rid of Natts_pg_class_fixed at long last.
Some stylistic cleanup too, and pay attention to keeping comments in sync
with code.

Documentation still needs work, though I did fix the omissions in
catalogs.sgml and indexam.sgml.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.124 2006/06/03 02:53:04 tgl Exp $ -->
d1643 24
d2049 6
a2054 3
       All rows inserted or deleted by transaction IDs before this one
       have been marked as known committed or known aborted in this database.
       This is used to determine when commit-log space can be recycled.
d2059 1
a2059 1
      <entry><structfield>datfrozenxid</structfield></entry>
d2063 1
d2066 4
a2069 2
       database.  This is useful to check whether a database must be vacuumed
       soon to avoid transaction ID wrap-around problems.
@


2.124
log
@Mention pg_encoding_to_char in entry for pg_database.encoding.
Per Larry Rosenman.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.123 2006/05/28 02:27:08 alvherre Exp $ -->
d502 7
d1653 9
@


2.123
log
@Remove traces of otherwise unused RELKIND_SPECIAL symbol.  Leave the psql bits
in place though, so that it plays nicely with older servers.

Per discussion.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.122 2006/05/02 22:25:09 tgl Exp $ -->
d1957 3
a1959 1
      <entry>Character encoding for this database</entry>
@


2.122
log
@Clean up API for ambulkdelete/amvacuumcleanup as per today's discussion.
This formulation requires every AM to provide amvacuumcleanup, unlike before,
but it's surely a whole lot cleaner.  Also, add an 'amstorage' column to
pg_am so that we can get rid of hardwired knowledge in DefineOpClass().
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.121 2006/03/10 19:10:46 momjian Exp $ -->
d1389 1
a1389 1
   and some kinds of special relation; see <structfield>relkind</>.
d1543 1
a1543 1
       composite type, <literal>s</> = special, <literal>t</> = TOAST
@


2.121
log
@Make $PostgreSQL CVS tags consistent for SGML files.
@
text
@d1 1
a1 1
<!-- $PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.49 2005/04/09 03:52:43 momjian Exp $ -->
d398 7
d412 7
@


2.120
log
@I've created a new shared catalog table pg_shdescription to store
comments on cluster global objects like databases, tablespaces, and
roles.

It touches a lot of places, but not much in the way of big changes.  The
only design decision I made was to duplicate the query and manipulation
functions rather than to try and have them handle both shared and local
comments.  I believe this is simpler for the code and not an issue for
callers because they know what type of object they are dealing with.
This has resulted in a shobj_description function analagous to
obj_description and backend functions [Create/Delete]SharedComments
mirroring the existing [Create/Delete]Comments functions.

pg_shdescription.h goes into src/include/catalog/

Kris Jurka
@
text
@d1 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.119 2006/01/21 19:05:59 tgl Exp $
@


2.119
log
@Fix broken markup.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.118 2006/01/18 06:49:25 neilc Exp $
d192 5
d2238 6
d3626 67
@


2.118
log
@Add a new system view, pg_cursors, that displays the currently available
cursors. Patch from Joachim Wieland, review and ediorialization by Neil
Conway. The view lists cursors defined by DECLARE CURSOR, using SPI, or
via the Bind message of the frontend/backend protocol. This means the
view does not list the unnamed portal or the portal created to implement
EXECUTE. Because we do list SPI portals, there might be more rows in
this view than you might expect if you are using SPI implicitly (e.g.
via a procedural language).

Per recent discussion on -hackers, the query string included in the
view for cursors defined by DECLARE CURSOR is based on
debug_query_string. That means it is not accurate if multiple queries
separated by semicolons are submitted as one query string. However,
there doesn't seem a trivial fix for that: debug_query_string
is better than nothing. I also changed SPI_cursor_open() to include
the source text for the portal it creates: AFAICS there is no reason
not to do this.

Update the documentation and regression tests, bump the catversion.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.117 2006/01/16 18:15:30 neilc Exp $
d4466 2
@


2.117
log
@Change the parameter_types column of the pg_prepared_statements to be
an array of regtype, rather than an array of OIDs. This is likely to
be more useful to user, and the type OID can easily be obtained by
casting a regtype value to OID. Per suggestion from Tom.

Update the documentation and regression tests, and bump the catversion.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.116 2006/01/08 07:00:24 neilc Exp $
d4363 5
d4437 125
@


2.116
log
@Add a new system view, pg_prepared_statements, that can be used to
access information about the prepared statements that are available
in the current session. Original patch from Joachim Wieland, various
improvements by Neil Conway.

The "statement" column of the view contains the literal query string
sent by the client, without any rewriting or pretty printing. This
means that prepared statements created via SQL will be prefixed with
"PREPARE ... AS ", whereas those prepared via the FE/BE protocol will
not. That is unfortunate, but discussion on -patches did not yield an
efficient way to improve this, and there is some merit in returning
exactly what the client sent to the backend.

Catalog version bumped, regression tests updated.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.115 2005/11/04 23:13:59 petere Exp $
d287 2
a288 2
       representation.  If this field is null, the transition state
       value starts out null.
d296 5
a300 4
   New aggregate functions are registered with the <command>CREATE
   AGGREGATE</command> command.  See <xref linkend="xaggr"> for more
   information about writing aggregate functions and the meaning of
   the transition functions, etc.
d1022 1
a1022 1
       Role may log in, that is, this role can be given as the initial
d1565 1
a1565 1
      <entry>unused  (<emphasis>not</emphasis> the number of unique keys)</entry>
d1572 1
a1572 1
      <entry>unused  (<emphasis>not</emphasis> the number of foreign keys on the table)</entry>
d1579 1
a1579 1
      <entry>unused</entry>
d1587 1
a1587 1
       True if we generate an OID for each row of the relation.
d1596 1
a1596 1
       True if the table has (or once had) a primary key.
d1605 1
a1605 1
       <structname>pg_rewrite</structname> catalog.
d1613 1
a1613 1
      <entry>True if table has (or once had) any inheritance children.</entry>
d1624 1
a1624 1
       for details.
d2034 1
a2034 1
       for details.
d2135 1
a2135 1
       A code defining the specific semantics of this dependency relationship; see text.
d2277 1
a2277 1
      <entry>Arbitrary text that serves as the description of this object.</entry>
d2339 1
a2339 1
      <entry>If true, this is a unique index.</entry>
d2354 1
a2354 1
      <entry>If true, the table was last clustered on this index.</entry>
d2389 1
a2389 1
      Null if all index attributes are simple references.</entry>
d2397 1
a2397 1
      for partial index predicate.  Null if not a partial index.</entry>
d2439 1
a2439 1
       The OID of the child table.
d2448 1
a2448 1
       The OID of the parent table.
d2560 1
a2560 1
       for details.
d2687 1
a2687 1
      <entry>PID of the server process that created this entry.</entry>
d2756 1
a2756 1
       for details.
d3034 2
a3035 2
   Unused column contain zeroes, for example <structfield>oprleft</structfield> is zero for a
   prefix operator.
d3127 4
a3130 3
   the table using ordinary INSERT, DELETE, or UPDATE commands.  It is
   likely that a future release of <productname>PostgreSQL</productname>
   will offer commands to change the entries in a cleaner fashion.
d3354 1
a3354 1
       for details.
d3557 1
a3557 1
       A code defining the specific semantics of this dependency relationship; see text.
d3748 2
a3749 2
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
       kind does not involve numerical values.
d3759 1
a3759 1
       <replaceable>N</>th <quote>slot</quote>, or null if the slot
d3836 1
a3836 1
       for details.
d3960 1
a3960 1
      <entry>Argument strings to pass to trigger, each null-terminated</entry>
d4379 1
a4379 1
      <entry>current prepared statements</entry>
d4384 1
a4384 1
      <entry>currently prepared transactions</entry>
d4689 1
a4689 1
       ID of the transaction that is holding or awaiting this lock.
d4698 1
a4698 1
       lock.  Null if the lock is held by a prepared transaction.
d4806 3
a4808 4
   prepared statement is created, and removed when a prepared
   statement is released (for example, via the <xref
   linkend="sql-deallocate" endterm="sql-deallocate-title">
   command).
d4829 1
a4829 1
       The identifier of the prepared statement.
d4850 1
a4850 1
       The time at which the prepared statement was created.
d4855 1
a4855 1
      <entry><type>oid[]</type></entry>
d4858 4
a4861 2
       The expected parameter types for the prepared statement in the form of
       an array of type OIDs.
d4872 1
a4872 1
       frontend/backend protocol.
d5739 1
a5739 1
      <entry>view definition (a reconstructed SELECT query)</entry>
@


2.115
log
@Spellchecking run, final cleanups
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.114 2005/09/13 01:51:18 alvherre Exp $
d4376 5
d4786 95
@


2.114
log
@Document the new autovacuum daemon.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.113 2005/09/08 20:07:41 tgl Exp $
d5419 1
a5419 1
   <xref linkend="guc-default-statistics-target"> runtime parameter.
@


2.113
log
@Create the pg_pltemplate system catalog to hold template information
for procedural languages.  This replaces the hard-wired table I had
originally proposed as a stopgap solution.  For the moment, the initial
contents only include languages shipped with the core distribution.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.112 2005/08/24 17:24:17 tgl Exp $
d1140 5
d1147 1
a1147 1
   per-relation configuration parameters for <quote>autovacuum</>.
@


2.112
log
@Add documentation for ALTER TABLE ENABLE/DISABLE TRIGGER.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.111 2005/08/11 21:11:41 tgl Exp $
d172 5
d3035 100
@


2.111
log
@Autovacuum loose end mop-up.  Provide autovacuum-specific vacuum cost
delay and limit, both as global GUCs and as table-specific entries in
pg_autovacuum.  stats_reset_on_server_start is now OFF by default,
but a reset is forced if we did WAL replay.  XID-wrap vacuums do not
ANALYZE, but do FREEZE if it's a template database.  Alvaro Herrera
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.110 2005/07/31 17:19:16 tgl Exp $
d3792 1
a3792 3
      <entry>True if trigger is enabled (not presently checked everywhere
      it should be, so disabling a trigger by setting this false does not
      work reliably)</entry>
@


2.110
log
@Add per-user and per-database connection limit options.
This patch also includes preliminary update of pg_dumpall for roles.
Petr Jelinek, with review by Bruce Momjian and Tom Lane.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.109 2005/07/26 16:38:25 tgl Exp $
d1200 14
d1234 5
a1238 1
   be used for this particular value.
@


2.109
log
@Add a role property 'rolinherit' which, when false, denotes that the role
doesn't automatically inherit the privileges of roles it is a member of;
for such a role, membership in another role can be exploited only by doing
explicit SET ROLE.  The default inherit setting is TRUE, so by default
the behavior doesn't change, but creating a user with NOINHERIT gives closer
adherence to our current reading of SQL99.  Documentation still lacking,
and I think the information schema needs another look.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.108 2005/07/14 05:13:38 tgl Exp $
d1022 10
d1935 10
d4835 10
@


2.108
log
@Integrate autovacuum functionality into the backend.  There's still a
few loose ends to be dealt with, but it seems to work.  Alvaro Herrera,
based on the contrib code by Matthew O'Connor.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.107 2005/07/07 20:39:56 tgl Exp $
d980 8
d4739 5
d4773 8
d4835 7
@


2.107
log
@Track dependencies on shared objects (which is to say, roles; we already
have adequate mechanisms for tracking the contents of databases and
tablespaces).  This solves the longstanding problem that you can drop a
user who still owns objects and/or has access permissions.
Alvaro Herrera, with some kibitzing from Tom Lane.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.106 2005/06/28 05:08:50 tgl Exp $
d92 5
d1110 98
@


2.106
log
@Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members.  There are still many loose ends to finish in this
patch (no documentation, no regression tests, no pg_dump support for
instance).  But I'm going to commit it now anyway so that Alvaro can
make some progress on shared dependencies.  The catalog changes should
be pretty much done.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.105 2005/06/18 19:33:41 tgl Exp $
d177 5
d1898 6
d3038 1
a3038 1
      <entry><type>"char"[]</type></entry>
d3212 143
d4353 1
a4353 1
       zero if the object is a globally-shared object, or
@


2.105
log
@Add a time-of-preparation column to the pg_prepared_xacts view, per an
old suggestion by Oliver Jowett.  Also, add a transaction column to the
pg_locks view to show the xid of each transaction holding or awaiting
locks; this allows prepared transactions to be properly associated with
the locks they own.  There was already a column named 'transaction',
and I chose to rename it to 'transactionid' --- since this column is
new in the current devel cycle there should be no backwards compatibility
issue to worry about.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.104 2005/06/17 22:32:41 tgl Exp $
d82 10
a126 5
      <entry><link linkend="catalog-pg-group"><structname>pg_group</structname></link></entry>
      <entry>groups of database users</entry>
     </row>

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

     <row>
d905 195
d1263 2
a1264 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d1690 2
a1691 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d1774 2
a1775 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
a2114 63
 <sect1 id="catalog-pg-group">
  <title><structname>pg_group</structname></title>

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

  <para>
   The catalog <structname>pg_group</structname> defines groups and stores what users belong to what
   groups.  Groups are created with the <command>CREATE
   GROUP</command> command.  Consult <xref linkend="user-manag"> for information
   about user privilege management.
  </para>

  <para>
   Because user and group identities are cluster-wide,
   <structname>pg_group</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_group</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_group</> Columns</title>

   <tgroup cols=4>
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>groname</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the group</entry>
     </row>

     <row>
      <entry><structfield>grosysid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>An arbitrary number to identify this group</entry>
     </row>

     <row>
      <entry><structfield>grolist</structfield></entry>
      <entry><type>int4[]</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
      <entry>An array containing the IDs of the users in this group</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


d2572 2
a2573 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d2652 3
a2654 3
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
      <entry>Operator class owner</entry>
d2741 2
a2742 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d2921 2
a2922 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d3201 2
a3202 2
 <sect1 id="catalog-pg-shadow">
  <title><structname>pg_shadow</structname></title>
d3204 2
a3205 2
  <indexterm zone="catalog-pg-shadow">
   <primary>pg_shadow</primary>
d3209 6
a3214 6
   The catalog <structname>pg_shadow</structname> contains information about
   database users.  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.
d3218 6
a3223 2
   <xref linkend="user-manag"> contains detailed information about user and
   privilege management.
d3227 9
a3235 5
   Because user identities are cluster-wide,
   <structname>pg_shadow</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_shadow</structname> per cluster, not
   one per database.
d3238 4
a3241 120
  <table>
   <title><structname>pg_shadow</> Columns</title>

   <tgroup cols=4>
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><structfield>usename</structfield></entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>User name</entry>
     </row>

     <row>
      <entry><structfield>usesysid</structfield></entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>User ID (arbitrary number used to reference this user)</entry>
     </row>

     <row>
      <entry><structfield>usecreatedb</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>User may create databases</entry>
     </row>

     <row>
      <entry><structfield>usesuper</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>User is a superuser</entry>
     </row>

     <row>
      <entry><structfield>usecatupd</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       User may update system catalogs.  (Even a superuser may not do
       this unless this column is true.)
      </entry>
     </row>

     <row>
      <entry><structfield>passwd</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>Password (possibly encrypted)</entry>
     </row>

     <row>
      <entry><structfield>valuntil</structfield></entry>
      <entry><type>abstime</type></entry>
      <entry></entry>
      <entry>Password expiry time (only used for password authentication)</entry>
     </row>

     <row>
      <entry><structfield>useconfig</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry></entry>
      <entry>Session defaults for run-time configuration variables</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


 <sect1 id="catalog-pg-statistic">
  <title><structname>pg_statistic</structname></title>

  <indexterm zone="catalog-pg-statistic">
   <primary>pg_statistic</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_statistic</structname> stores statistical data
   about the contents of the database.  Entries are created by
   <command>ANALYZE</command> and subsequently used by the query planner.
   There is one entry for each table column that has been analyzed.
   Note that all the statistical data is inherently approximate,
   even assuming that it is up-to-date.
  </para>

  <para>
   <structname>pg_statistic</structname> also stores statistical data about
   the values of index expressions.  These are described as if they were
   actual data columns; in particular, <structfield>starelid</structfield>
   references the index.  No entry is made for an ordinary non-expression
   index column, however, since it would be redundant with the entry
   for the underlying table column.
  </para>

  <para>
   Since different kinds of statistics may be appropriate for different
   kinds of data, <structname>pg_statistic</structname> is designed not
   to assume very much about what sort of statistics it stores.  Only
   extremely general statistics (such as nullness) are given dedicated
   columns in <structname>pg_statistic</structname>.  Everything else
   is stored in <quote>slots</quote>, which are groups of associated columns
   whose content is identified by a code number in one of the slot's columns.
   For more information see
   <filename>src/include/catalog/pg_statistic.h</filename>.
  </para>

  <para>
   <structname>pg_statistic</structname> should not be readable by the
   public, since even statistical information about a table's contents
   may be considered sensitive.  (Example: minimum and maximum values
d3401 2
a3402 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d3613 2
a3614 2
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
d3950 5
d3970 5
d3985 5
d4014 56
d4430 1
a4430 1
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usename</literal></entry>
d4459 104
d4736 101
d5023 1
a5023 1
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usename</literal></entry>
d5067 1
a5067 1
   <link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>
d5188 1
a5188 1
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usename</literal></entry>
@


2.104
log
@Two-phase commit.  Original patch by Heikki Linnakangas, with additional
hacking by Alvaro Herrera and Tom Lane.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.103 2005/06/13 23:14:47 tgl Exp $
d4093 1
a4093 1
       <literal>transaction</>,
d4135 1
a4135 1
      <entry><structfield>transaction</structfield></entry>
d4172 8
d4185 1
a4185 1
       lock.  Zero if the lock is held by a prepared transaction.
d4207 1
a4207 1
   held by the indicated session.  False indicates that this session is
d4209 4
a4212 4
   session is holding a conflicting lock mode on the same lockable object.
   The waiting session will sleep until the other lock is released (or a
   deadlock situation is detected). A single session can be waiting to acquire
   at most one lock at a time.
d4264 7
d4325 8
@


2.103
log
@Change the planner to allow indexscan qualification clauses to use
nonconsecutive columns of a multicolumn index, as per discussion around
mid-May (pghackers thread "Best way to scan on-disk bitmaps").  This
turns out to require only minimal changes in btree, and so far as I can
see none at all in GiST.  btcostestimate did need some work, but its
original assumption that index selectivity == heap selectivity was
quite bogus even before this.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.102 2005/05/17 21:46:09 tgl Exp $
d3936 5
d4175 4
a4178 2
      <entry>process ID of the server process holding or awaiting this
      lock</entry>
d4260 81
@


2.102
log
@Extend the pg_locks system view so that it can fully display all lock
types, as per recent discussion.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.101 2005/05/06 14:28:53 tgl Exp $
d362 8
@


2.101
log
@Update misleading comment about the use of lanpltrusted ... it is
significant regardless of the value of lanispl.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.100 2005/04/12 04:26:13 tgl Exp $
d4043 1
a4043 2
   will not appear at all.  A lockable object is either a relation (e.g., a
   table) or a transaction ID.
d4047 8
a4054 4
   Note that this view includes only table-level
   locks, not row-level ones.  If a transaction is waiting for a
   row-level lock, it will appear in the view as waiting for the
   transaction ID of the current holder of that row lock.
d4071 25
d4100 2
a4101 2
       OID of the locked relation, or NULL if the lockable object
       is a transaction ID
d4105 12
a4116 3
      <entry><structfield>database</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
d4118 1
a4118 3
       OID of the database in which the locked relation exists, or
       zero if the locked relation is a globally-shared table, or
       NULL if the lockable object is a transaction ID
d4126 30
a4155 1
       ID of a transaction, or NULL if the lockable object is a relation
d4162 1
a4162 1
      <entry>process ID of a server process holding or awaiting this
d4201 15
@


2.100
log
@Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can
be supported for all datatypes.  Add CREATE AGGREGATE and pg_dump support
too.  Add specialized min/max aggregates for bpchar, instead of depending
on text's min/max, because otherwise the possible use of bpchar indexes
cannot be recognized.
initdb forced because of catalog changes.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.99 2005/03/29 19:44:22 tgl Exp $
d2211 4
a2214 3
       This is a trusted language.  If this is an internal
       language (<structfield>lanispl</structfield> is false) then
       this column is meaningless.
@


2.99
log
@Add proallargtypes and proargmodes columns to pg_proc, as per my earlier
proposal for OUT parameter support.  The columns don't actually *do*
anything yet, they are just left NULLs.  But I thought I'd commit this
part separately as a fairly pure example of the tasks needed when adding
a column to pg_proc or one of the other core system tables.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.98 2005/03/29 00:16:49 tgl Exp $
d254 6
d263 1
a263 1
      <entry>The type of the aggregate function's internal transition (state) data</entry>
d272 1
a272 1
       representation.  If the value is null, the transition state
@


2.98
log
@Convert oidvector and int2vector into variable-length arrays.  This
change saves a great deal of space in pg_proc and its primary index,
and it eliminates the former requirement that INDEX_MAX_KEYS and
FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
in the on-disk representation (because it affects index tuple header
size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
There are still a lot of vestigial references to FUNC_MAX_ARGS, which
I will clean up in a separate pass.  However, getting rid of it
altogether would require changing the FunctionCallInfoData struct,
and I'm not sure I want to buy into that.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.97 2005/03/27 23:52:51 tgl Exp $
d2858 33
a2890 1
      <entry>An array with the data types of the function arguments</entry>
d2900 3
a2902 1
        If none of the arguments have a name, this field may be null.
@


2.97
log
@First steps towards index scans with heap access decoupled from index
access: define new index access method functions 'amgetmulti' that can
fetch multiple TIDs per call.  (The functions exist but are totally
untested as yet.)  Since I was modifying pg_am anyway, remove the
no-longer-needed 'rel' parameter from amcostestimate functions, and
also remove the vestigial amowner column that was creating useless
work for Alvaro's shared-object-dependencies project.
Initdb forced due to changes in pg_am.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.96 2005/02/13 03:04:15 tgl Exp $
a2010 26
      <entry><structfield>indkey</structfield></entry>
      <entry><type>int2vector</type></entry>
      <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
      <entry>
       This is an array of <structfield>indnatts</structfield> (up to
       <symbol>INDEX_MAX_KEYS</symbol>) values that indicate which
       table columns this index indexes.  For example a value of
       <literal>1 3</literal> would mean that the first and the third table
       columns make up the index key.  A zero in this array indicates that the
       corresponding index attribute is an expression over the table columns,
       rather than a simple column reference.
      </entry>
     </row>

     <row>
      <entry><structfield>indclass</structfield></entry>
      <entry><type>oidvector</type></entry>
      <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
      <entry>
       For each column in the index key this contains the OID of
       the operator class to use.  See
       <structname>pg_opclass</structname> for details.
      </entry>
     </row>

     <row>
d2041 25
d3639 1
a3639 1
       <type>name</type> and <type>oidvector</type>.
@


2.96
log
@Write some real documentation about the index access method API.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.95 2005/01/05 23:42:03 tgl Exp $
a319 7
      <entry><structfield>amowner</structfield></entry>
      <entry><type>int4</type></entry>
      <entry><literal><link linkend="catalog-pg-shadow"><structname>pg_shadow</structname></link>.usesysid</literal></entry>
      <entry>User ID of the owner (currently not used)</entry>
     </row>

     <row>
d370 8
a377 1
      <entry><structfield>amgettuple</structfield></entry>
d380 1
a380 1
      <entry><quote>Next valid tuple</quote> function</entry>
d384 1
a384 1
      <entry><structfield>aminsert</structfield></entry>
d387 1
a387 1
      <entry><quote>Insert this tuple</quote> function</entry>
d391 1
a391 1
      <entry><structfield>ambeginscan</structfield></entry>
d394 1
a394 1
      <entry><quote>Start new scan</quote> function</entry>
@


2.95
log
@More minor updates and copy-editing.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.94 2004/12/13 18:05:07 petere Exp $
d292 4
a295 3
   The catalog <structname>pg_am</structname> stores information about index access
   methods.  There is one row for each index access method supported by
   the system.
a456 14
   <para>
    An index access method that supports multiple columns (has
    <structfield>amcanmulticol</structfield> true) <emphasis>must</>
    support indexing null values in columns after the first, because the planner
    will assume the index can be used for queries on just the first
    column(s).  For example, consider an index on (a,b) and a query with
    <literal>WHERE a = 4</literal>.  The system will assume the index can be used to scan for
    rows with <literal>a = 4</literal>, which is wrong if the index omits rows where <literal>b</> is null.
    It is, however, OK to omit rows where the first indexed column is null.
    (GiST currently does so.)
    <structfield>amindexnulls</structfield> should be set true only if the
    index access method indexes all rows, including arbitrary combinations of null values.
   </para>

@


2.94
log
@Spell checker run
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.93 2004/12/01 19:00:27 tgl Exp $
d36 1
a36 1
   these are marked in the descriptions of the individual catalogs.
d88 1
a88 1
      <entry>tables, indexes, sequences (<quote>relations</quote>)</entry>
d666 8
d689 2
a690 1
   indexes and other objects.  See <structname>pg_class</structname>.)
d740 1
a740 1
       <command>ANALYZE</command>.
d890 11
d1253 2
a1254 2
      <entry>Table has rules; see
       <structname>pg_rewrite</structname> catalog
d1262 1
a1262 1
      <entry>At least one table inherits from this one</entry>
d1270 4
a1273 3
       Access privileges; see the descriptions of
       <command>GRANT</command> and <command>REVOKE</command> for
       details.
d1456 4
a1459 2
   The catalog <structname>pg_conversion</structname> stores encoding conversion information. See
   <command>CREATE CONVERSION</command> for more information.
d1669 6
a1674 1
      <entry>Access privileges</entry>
d1858 2
a1859 2
   The catalog <structname>pg_description</> can store an optional description or
   comment for each database object.  Descriptions can be manipulated
d2112 3
a2114 1
   table inheritance hierarchies.
d2154 1
a2154 1
       If there is more than one parent for a child table (multiple
d2174 1
a2174 1
   The catalog <structname>pg_language</structname> registers call interfaces or
d2176 2
a2177 2
   See under <command>CREATE LANGUAGE</command> and in
   <xref linkend="xplang"> for more information about language handlers.
d2198 1
a2198 1
      <entry>Name of the language (to be specified when creating a function)</entry>
d2219 1
a2219 2
       This is a trusted language.  See under <command>CREATE
       LANGUAGE</command> what this means.  If this is an internal
d2244 1
a2244 2
       are created. See under <command>CREATE LANGUAGE</command> for
       further information about validators.
d2252 6
a2257 1
      <entry>Access privileges</entry>
d2345 4
a2348 2
   The catalog <structname>pg_listener</structname> supports the <command>LISTEN</>
   and <command>NOTIFY</> commands.  A listener creates an entry in
d2448 6
a2453 1
      <entry>Access privileges</entry>
d2571 3
a2573 3
   The catalog <structname>pg_operator</> stores information about operators.  See
   <command>CREATE OPERATOR</command> and <xref linkend="xoper"> for
   details on these operator parameters.
d2746 2
a2747 3
   The description of <command>CREATE FUNCTION</command> and
   <xref linkend="xfunc"> contain more information about the meaning of
   some columns.
d2911 6
a2916 1
      <entry>Access privileges</entry>
d2923 1
d2925 1
a2925 2
   name (link symbol) for compiled functions, both built-in and
   dynamically loaded.  For all other language types,
d3088 1
a3088 1
      <entry>User id (arbitrary number used to reference this user)</entry>
d3119 1
a3119 1
      <entry>Password</entry>
d3126 1
a3126 1
      <entry>Account expiry time (only used for password authentication)</entry>
d3358 6
a3363 1
      <entry>Access privileges</entry>
d3379 3
a3381 2
   The catalog <structname>pg_trigger</structname> stores triggers on tables.  See under
   <command>CREATE TRIGGER</command> for more information.
d3496 2
a3497 2
    <literal>pg_class.reltriggers</literal> needs to match up with the
    entries in this table.
d3512 5
a3516 2
   The catalog <structname>pg_type</structname> stores information about data types.  Base types
   (scalar types) are created with <command>CREATE TYPE</command>.
d3519 1
a3519 2
   composite types with <command>CREATE TYPE AS</command> and
   domains with <command>CREATE DOMAIN</command>.
d3852 3
a3854 11
   provides a number of built-in views.  The system views provide convenient
   access to some commonly used queries on the system catalogs.  Some of these
   views provide access to internal server state, as well.
  </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 the results of
   the statistics collector; they are described in <xref
   linkend="monitoring-stats-views-table">.
d3867 8
d4453 1
a4453 1
   <varname>default_statistics_target</varname> runtime parameter.
d4570 1
a4570 1
      <entry>User id (arbitrary number used to reference this user)</entry>
d4608 1
a4608 1
      <entry>Account expiry time (only used for password authentication)</entry>
@


2.93
log
@Change planner to use the current true disk file size as its estimate of
a relation's number of blocks, rather than the possibly-obsolete value
in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
to arrive at a hopefully more accurate number of rows.  When pg_class
contains 0/0, estimate a tuple width from the column datatypes and divide
that into current file size to estimate number of rows.  This improved
methodology allows us to jettison the ancient hacks that put bogus default
values into pg_class when a table is first created.  Also, per a suggestion
from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
it puts into pg_class.reltuples to try to represent the mean tuple density
instead of the minimal density that actually prevails just after VACUUM.
These changes alter the plans selected for certain regression tests, so
update the expected files accordingly.  (I removed join_1.out because
it's not clear if it still applies; we can add back any variant versions
as they are shown to be needed.)
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.92 2004/11/15 06:32:13 neilc Exp $
d983 1
a983 1
   convert between datatypes and a second to apply the modifier.
d1040 1
a1040 1
       The OID of the data type that corresponds to this table's rowtype,
d2013 1
a2013 1
      <entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</entry>
@


2.92
log
@Replace "--" and "---" with "&mdash;" as appropriate, for better-looking
output.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.91 2004/11/05 19:15:48 tgl Exp $
d1082 1
a1082 1
       Size of the on-disk representation of this table in pages (size
d1086 2
a1087 1
       <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
d1099 2
a1100 1
       <command>ANALYZE</command>, and <command>CREATE INDEX</command>.
@


2.91
log
@Create 'default_tablespace' GUC variable that supplies a TABLESPACE
clause implicitly whenever one is not given explicitly.  Remove concept
of a schema having an associated tablespace, and simplify the rules for
selecting a default tablespace for a table or index.  It's now just
(a) explicit TABLESPACE clause; (b) default_tablespace if that's not an
empty string; (c) database's default.  This will allow pg_dump to use
SET commands instead of tablespace clauses to determine object locations
(but I didn't actually make it do so).  All per recent discussions.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.90 2004/10/11 17:24:39 tgl Exp $
d19 1
a19 1
   <structname>pg_database</structname> catalog --- and actually
d2512 1
a2512 1
   part of the operator class definition --- this is not unlike the way
d4278 1
a4278 1
   --- at the cost that its schema must be extended whenever new slot types
@


2.90
log
@Fix pg_indexes view so that it shows the index's tablespace not the
parent table's tablespace, as per gripe from Michael Kleiser.  Choose
a more plausible column order for this view and pg_tables.  Update
documentation of these views, which was missed in original patch.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.89 2004/07/04 23:34:23 tgl Exp $
a2407 11
      <entry><structfield>nsptablespace</structfield></entry>
      <entry><type>oid</type></entry>
      <entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
      <entry>
       The default tablespace in which to place relations created in this
       namespace.  If zero, the database's default tablespace is implied.
       (Changing this does not affect pre-existing relations.)
      </entry>
     </row>

     <row>
@


2.89
log
@Fix misspellings: langauge -> language.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.88 2004/06/18 06:13:02 tgl Exp $
d3936 6
d4459 6
@


2.88
log
@Tablespaces.  Alternate database locations are dead, long live tablespaces.

There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation.  Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE.  Also initlocation is
dead, it just doesn't know it yet.

Gavin Sherry and Tom Lane.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.87 2004/06/16 01:26:33 tgl Exp $
d2766 1
a2766 1
      <entry><literal><link linkend="catalog-pg-language"><structname>pg_langauge</structname></link>.oid</literal></entry>
@


2.87
log
@Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names.  Allow
pg_cast entries to represent both type coercion and length coercion in
a single step --- this is represented by a function that takes an
extra typmod argument, just like a length coercion function.  This
nicely merges the type and length coercion mechanisms into something
at least a little cleaner than we had before.  Make use of the single-
coercion-step behavior to fix integer-to-bit coercion so that coercing
to bit(n) yields the rightmost n bits of the integer instead of the
leftmost n bits.  This should fix recurrent complaints about the odd
behavior of this coercion.  Clean up the documentation of the bit string
functions, and try to put it where people might actually find it.
Also, get rid of the unreliable heuristics in ruleutils.c about whether
to display nested coercion steps; instead require parse_coerce.c to
label them properly in the first place.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.86 2004/06/07 04:04:47 tgl Exp $
d182 5
d1067 11
d1621 3
a1623 3
      <entry><structfield>datpath</structfield></entry>
      <entry><type>text</type></entry>
      <entry></entry>
d1625 5
a1629 3
       If the database is stored at an alternative location then this
       records the location.  It's either an environment variable name
       or an absolute path, depending how it was entered.
d2408 11
d3261 67
@


2.86
log
@Some preliminary documentation for composite-type stuff.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.85 2004/04/01 21:28:43 tgl Exp $
d937 1
a937 1
       <literal>CAST</>, <literal>::</>, or function-call syntax).
d947 33
@


2.85
log
@Replace TupleTableSlot convention for whole-row variables and function
results with tuples as ordinary varlena Datums.  This commit does not
in itself do much for us, except eliminate the horrid memory leak
associated with evaluation of whole-row variables.  However, it lays the
groundwork for allowing composite types as table columns, and perhaps
some other useful features as well.  Per my proposal of a few days ago.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.84 2004/02/15 21:01:38 tgl Exp $
d960 2
a961 2
   <structname>pg_index</structname>), sequences, views, and some
   kinds of special relation; see <structfield>relkind</>.
d1002 2
a1003 2
       The OID of the data type that corresponds to this table, if any
       (zero for indexes, which have no <structname>pg_type</> entry)
d3423 1
a3423 1
       a base type, <literal>c</literal> for a composite type (i.e., a
d3464 1
a3464 1
       Zero for base types.
@


2.84
log
@First steps towards statistics on expressional (nee functional) indexes.
This commit teaches ANALYZE to store such stats in pg_statistic, but
nothing is done yet about teaching the planner to use 'em.
Also, repair longstanding oversight in separate ANALYZE command: it
updated the pg_class.relpages and reltuples counts for the table proper,
but not for indexes.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.83 2004/02/12 23:41:00 tgl Exp $
a808 18
      </entry>
     </row>

     <row>
      <entry><structfield>attisset</structfield></entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>
       If true, this attribute is a set.  In that case, what is really
       stored in the attribute is the OID of a row in the
       <structname>pg_proc</structname> catalog.  The
       <structname>pg_proc</structname> row contains the query
       string that defines this set, i.e., the query to run to get
       the set.  So the <structfield>atttypid</structfield> (see
       above) refers to the type returned by this query, but the
       actual length of this attribute is the length (size) of an
       <type>oid</type>.  --- At least this is the theory.  All this
       is probably quite broken these days.
@


2.83
log
@Add hooks for type-specific calculation of ANALYZE statistics.  Idea and
coding by Mark Cave-Ayland, some kibitzing by Tom Lane.  initdb forced
due to new column in pg_type.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.82 2004/01/06 23:55:18 tgl Exp $
d3071 2
a3072 2
   The catalog <structname>pg_statistic</structname> stores statistical data about
   the contents of the database.  Entries are created by
d3080 9
d3094 2
a3095 2
   is stored in <quote>slots</quote>, which are groups of associated columns whose
   content is identified by a code number in one of the slot's columns.
d3129 1
a3129 1
      <entry>The table that the described column belongs to</entry>
@


2.82
log
@Apply the core parts of Dennis Bjorklund's patch to allow function
parameters to be declared with names.  pg_proc has a column to store
names, and CREATE FUNCTION can insert data into it, but that's all as
yet.  I need to do more work on the pg_dump and plpgsql portions of the
patch before committing those, but I thought I'd get the bulky changes
in before the tree drifts under me.
initdb forced due to pg_proc change.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.81 2003/12/06 23:10:21 joe Exp $
d3525 7
@


2.81
log
@Documentation update for previously committed changes: read-only GUC variables
and pg_settings view.
@
text
@d3 1
a3 1
 $PostgreSQL: pgsql-server/doc/src/sgml/catalogs.sgml,v 2.80 2003/11/29 19:51:36 pgsql Exp $
d2799 11
@


2.80
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d3 1
a3 1
 $PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.79 2003/11/12 21:15:42 tgl Exp $
d4052 18
@


2.79
log
@Cross-data-type comparisons are now indexable by btrees, pursuant to my
pghackers proposal of 8-Nov.  All the existing cross-type comparison
operators (int2/int4/int8 and float4/float8) have appropriate support.
The original proposal of storing the right-hand-side datatype as part of
the primary key for pg_amop and pg_amproc got modified a bit in the event;
it is easier to store zero as the 'default' case and only store a nonzero
when the operator is actually cross-type.  Along the way, remove the
long-since-defunct bigbox_ops operator class.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.78 2003/11/02 12:53:57 petere Exp $
@


2.78
log
@Call domains "domains", not "derived types".
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.77 2003/11/01 01:56:28 petere Exp $
d503 8
d574 7
d2453 1
a2453 1
      <entry>Input data type of the operator class</entry>
d2467 1
a2467 1
      <entry>Type of index data, or zero if same as <structfield>opcintype</></entry>
@


2.77
log
@Spell checking, consistent terminology.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.76 2003/10/17 22:38:20 tgl Exp $
d3330 1
a3330 1
   derived types with <command>CREATE DOMAIN</command>.
d3406 5
a3410 5
       a base type, <literal>c</literal> for a composite type (i.e.,
       a table's row type), <literal>d</literal> for a derived type (i.e.,
       a domain), or <literal>p</literal> for a pseudo-type.  See also
       <structfield>typrelid</structfield>
       and <structfield>typbasetype</structfield>.
d3591 1
a3591 1
       If this is a derived type (see <structfield>typtype</structfield>),
d3593 1
a3593 1
       the type that this one is based on.  Zero if not a derived type.
@


2.76
log
@Document all the system views created by initdb (several of these were
never documented anywhere, sigh).  Centralize the detailed documentation
of system views into catalogs.sgml, and provide cross-references.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.75 2003/10/17 00:55:17 tgl Exp $
d758 1
a758 1
       Always -1 in storage, but when loaded into a tuple descriptor
d760 1
a760 1
       within the tuple.
d803 1
a803 1
       stored in the attribute is the OID of a tuple in the
d805 1
a805 1
       <structname>pg_proc</structname> tuple contains the query
d1049 1
a1049 1
       Number of tuples in the table.
d1556 1
a1556 1
       All tuples inserted or deleted by transaction IDs before this one
d1567 1
a1567 1
       All tuples inserted by transaction IDs before this one have been
d1669 1
a1669 1
      <entry>any oid attribute</entry>
d1948 1
a1948 1
      <entry><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</entry>
d2410 1
a2410 1
      <entry>Index access method opclass is for</entry>
d3236 1
a3236 1
      <entry>Bitmask identifying trigger conditions</entry>
d3537 1
a3537 1
        a struct representing a table row.
d3614 2
a3615 2
       for a domain that is an array (that is, typbasetype is an array type;
       the domain's typelem will match the base type's typelem).
@


2.75
log
@Add note deprecating use of consrc.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.74 2003/09/12 22:17:19 tgl Exp $
d2940 3
a2942 2
   <structfield>pg_user</structfield> is a publicly readable view on
   <structfield>pg_shadow</structfield> that blanks out the password field.
d3070 2
a3071 1
   <structname>pg_stats</structname> is a publicly readable view on
a3073 4
   <structname>pg_stats</structname> is also designed to present the
   information in a more readable format than the underlying
   <structname>pg_statistic</structname> table --- at the cost that
   its schema must be extended whenever new slot types are added.
d3650 802
@


2.74
log
@Update obsolete examples of error messages; various other minor editing.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.73 2003/06/25 01:14:37 momjian Exp $
d1359 9
@


2.73
log
@Create <link> entries for the foreign keys in the system catalog
chapter.

I got tired of hitting the 'up' link, then finding the table in the
table of contents, and following it back down.

Rod Taylor
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.72 2003/06/22 22:04:54 tgl Exp $
d625 1
a625 1
      <entry><literal>pg_attribute.attnum</literal></entry>
d1653 1
a1653 1
      <entry><literal>pg_class.oid</literal></entry>
d3582 1
a3582 1
      <entry><literal>pg_type.oid</literal></entry>
@


2.72
log
@Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.71 2003/05/28 16:03:55 tgl Exp $
d233 1
a233 1
      <entry><literal>pg_proc.oid</literal></entry>
d239 1
a239 1
      <entry><literal>pg_proc.oid</literal></entry>
d245 1
a245 1
      <entry><literal>pg_proc.oid</literal></entry>
d251 1
a251 1
      <entry><literal>pg_type.oid</literal></entry>
d316 1
a316 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d373 1
a373 1
      <entry><literal>pg_proc.oid</literal></entry>
d380 1
a380 1
      <entry><literal>pg_proc.oid</literal></entry>
d387 1
a387 1
      <entry><literal>pg_proc.oid</literal></entry>
d394 1
a394 1
      <entry><literal>pg_proc.oid</literal></entry>
d401 1
a401 1
      <entry><literal>pg_proc.oid</literal></entry>
d408 1
a408 1
      <entry><literal>pg_proc.oid</literal></entry>
d415 1
a415 1
      <entry><literal>pg_proc.oid</literal></entry>
d422 1
a422 1
      <entry><literal>pg_proc.oid</literal></entry>
d429 1
a429 1
      <entry><literal>pg_proc.oid</literal></entry>
d436 1
a436 1
      <entry><literal>pg_proc.oid</literal></entry>
d443 1
a443 1
      <entry><literal>pg_proc.oid</literal></entry>
d498 1
a498 1
      <entry><literal>pg_opclass.oid</literal></entry>
d519 1
a519 1
      <entry><literal>pg_operator.oid</literal></entry>
d561 1
a561 1
      <entry><literal>pg_opclass.oid</literal></entry>
d575 1
a575 1
      <entry><literal>pg_proc.oid</literal></entry>
d618 1
a618 1
      <entry><literal>pg_class.oid</literal></entry>
d686 1
a686 1
      <entry><literal>pg_class.oid</literal></entry>
d700 1
a700 1
      <entry><literal>pg_type.oid</literal></entry>
d911 1
a911 1
      <entry><literal>pg_type.oid</literal></entry>
d918 1
a918 1
      <entry><literal>pg_type.oid</literal></entry>
d925 1
a925 1
      <entry><literal>pg_proc.oid</literal></entry>
d994 1
a994 1
      <entry><literal>pg_namespace.oid</literal></entry>
d1003 1
a1003 1
      <entry><literal>pg_type.oid</literal></entry>
d1013 1
a1013 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d1020 1
a1020 1
      <entry><literal>pg_am.oid</literal></entry>
d1059 1
a1059 1
      <entry><literal>pg_class.oid</literal></entry>
d1070 1
a1070 1
      <entry><literal>pg_class.oid</literal></entry>
d1255 1
a1255 1
      <entry><literal>pg_namespace.oid</literal></entry>
d1290 1
a1290 1
      <entry><literal>pg_class.oid</literal></entry>
d1297 1
a1297 1
      <entry><literal>pg_type.oid</literal></entry>
d1304 1
a1304 1
      <entry><literal>pg_class.oid</literal></entry>
d1332 1
a1332 1
      <entry><literal>pg_attribute.attnum</></entry>
d1339 1
a1339 1
      <entry><literal>pg_attribute.attnum</></entry>
d1406 1
a1406 1
      <entry><literal>pg_namespace.oid</literal></entry>
d1415 1
a1415 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d1436 1
a1436 1
      <entry><literal>pg_proc.oid</literal></entry>
d1499 1
a1499 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d1627 1
a1627 1
      <entry><literal>pg_class.oid</literal></entry>
d1803 1
a1803 1
      <entry><literal>pg_class.oid</literal></entry>
d1885 1
a1885 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d1925 1
a1925 1
      <entry><literal>pg_class.oid</literal></entry>
d1932 1
a1932 1
      <entry><literal>pg_class.oid</literal></entry>
d1939 1
a1939 1
      <entry>pg_attribute.attnum</entry>
d1954 1
a1954 1
      <entry>pg_opclass.oid</entry>
d2045 1
a2045 1
      <entry><literal>pg_class.oid</literal></entry>
d2054 1
a2054 1
      <entry><literal>pg_class.oid</literal></entry>
d2140 1
a2140 1
      <entry><literal>pg_proc.oid</literal></entry>
d2152 1
a2152 1
      <entry><literal>pg_proc.oid</literal></entry>
d2346 1
a2346 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d2400 1
a2400 1
      <entry><literal>pg_am.oid</literal></entry>
d2414 1
a2414 1
      <entry><literal>pg_namespace.oid</literal></entry>
d2421 1
a2421 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d2428 1
a2428 1
      <entry><literal>pg_type.oid</literal></entry>
d2442 1
a2442 1
      <entry><literal>pg_type.oid</literal></entry>
d2501 1
a2501 1
      <entry><literal>pg_namespace.oid</literal></entry>
d2510 1
a2510 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d2534 1
a2534 1
      <entry><literal>pg_type.oid</literal></entry>
d2541 1
a2541 1
      <entry><literal>pg_type.oid</literal></entry>
d2548 1
a2548 1
      <entry><literal>pg_type.oid</literal></entry>
d2555 1
a2555 1
      <entry><literal>pg_operator.oid</literal></entry>
d2562 1
a2562 1
      <entry><literal>pg_operator.oid</literal></entry>
d2569 1
a2569 1
      <entry><literal>pg_operator.oid</literal></entry>
d2579 1
a2579 1
      <entry><literal>pg_operator.oid</literal></entry>
d2589 1
a2589 1
      <entry><literal>pg_operator.oid</literal></entry>
d2599 1
a2599 1
      <entry><literal>pg_operator.oid</literal></entry>
d2609 1
a2609 1
      <entry><literal>pg_proc.oid</literal></entry>
d2616 1
a2616 1
      <entry><literal>pg_proc.oid</literal></entry>
d2623 1
a2623 1
      <entry><literal>pg_proc.oid</literal></entry>
d2682 1
a2682 1
      <entry><literal>pg_namespace.oid</literal></entry>
d2691 1
a2691 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d2698 1
a2698 1
      <entry><literal>pg_language.oid</literal></entry>
d2766 1
a2766 1
      <entry><literal>pg_type.oid</literal></entry>
d2773 1
a2773 1
      <entry><literal>pg_type.oid</literal></entry>
d2855 1
a2855 1
      <entry><literal>pg_class.oid</literal></entry>
d3086 1
a3086 1
      <entry><literal>pg_class.oid</literal></entry>
d3093 1
a3093 1
      <entry><literal>pg_attribute.attnum</literal></entry>
d3138 1
a3138 1
      <entry><literal>pg_operator.oid</literal></entry>
d3207 1
a3207 1
      <entry><literal>pg_class.oid</literal></entry>
d3221 1
a3221 1
      <entry><literal>pg_proc.oid</literal></entry>
d3258 1
a3258 1
      <entry><literal>pg_class.oid</literal></entry>
d3350 1
a3350 1
      <entry><literal>pg_namespace.oid</literal></entry>
d3359 1
a3359 1
      <entry><literal>pg_shadow.usesysid</literal></entry>
d3431 1
a3431 1
      <entry><literal>pg_class.oid</literal></entry>
d3447 1
a3447 1
      <entry><literal>pg_type.oid</literal></entry>
d3469 1
a3469 1
      <entry><literal>pg_proc.oid</literal></entry>
d3476 1
a3476 1
      <entry><literal>pg_proc.oid</literal></entry>
d3483 1
a3483 1
      <entry><literal>pg_proc.oid</literal></entry>
d3490 1
a3490 1
      <entry><literal>pg_proc.oid</literal></entry>
@


2.71
log
@Replace functional-index facility with expressional indexes.  Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.70 2003/05/08 22:19:55 tgl Exp $
d2528 1
a2528 1
      <entry>This operator supports hash joins.</entry>
@


2.70
log
@Reinstate pg_type's typsend and typreceive columns.  They don't do much
yet, but they're there.  Also some editorial work on CREATE TYPE reference
page.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.69 2003/04/15 13:23:35 petere Exp $
a1936 8
      <entry><structfield>indproc</structfield></entry>
      <entry><type>regproc</type></entry>
      <entry><literal>pg_proc.oid</literal></entry>
      <entry>The function's OID if this is a functional index,
      else zero</entry>
     </row>

     <row>
d1941 7
a1947 7
       This is an array of up to
       <symbol>INDEX_MAX_KEYS</symbol> values that indicate which
       table columns this index pertains to.  For example a value of
       <literal>1 3</literal> would mean that the first and the third
       column make up the index key.  For a functional index, these
       columns are the inputs to the function, and the function's return
       value is the index key.
d1956 1
a1956 1
       For each column in the index key this contains a reference to
d1963 2
a1964 2
      <entry><structfield>indisclustered</structfield></entry>
      <entry><type>bool</type></entry>
d1966 2
a1967 1
      <entry>If true, the table was last clustered on this index.</entry>
d1986 9
a1994 2
      <entry><structfield>indreference</structfield></entry>
      <entry><type>oid</type></entry>
d1996 4
a1999 1
      <entry>unused</entry>
d2006 2
a2007 3
      <entry>Expression tree (in the form of a <function>nodeToString()</function> representation)
      for partial index predicate.  Empty string if not a partial
      index.</entry>
@


2.69
log
@Add better markup and improve some text here and there.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.68 2003/03/25 16:15:35 petere Exp $
d3318 1
a3318 1
   A complex type is automatically created for each table in the database, to
d3320 1
a3320 1
   complex types with <command>CREATE TYPE AS</command> and
d3381 3
a3383 6
       Only <type>char</type>, <type>short</type>, and
       <type>int</type> equivalent items can be passed by value, so if
       the type is not 1, 2, or 4 bytes long,
       <productname>PostgreSQL</> does not have
       the option of passing by value and so
       <structfield>typbyval</structfield> had better be false.
d3397 1
a3397 1
       a base type, <literal>c</literal> for a complex type (i.e.,
d3431 1
a3431 1
       If this is a complex type (see
d3468 1
a3468 1
      <entry>Input conversion function</entry>
d3475 15
a3489 1
      <entry>Output conversion function</entry>
@


2.68
log
@Merge documentation into one book.  (Build with "make html".)  Replace
vague cross-references with real links.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.67 2003/03/23 05:14:36 tgl Exp $
a8 3
 <sect1 id="catalogs-overview">
  <title>Overview</title>

d16 1
a16 1
   Normally one should not change the system catalogs by hand, there
d19 1
a19 1
   <structname>pg_database</structname> catalog -- and actually
d21 9
a29 1
   especially esoteric operations, such as adding index access methods.
d31 1
d34 2
a35 2
   database creation, and are thereafter database-specific. A few
   catalogs are physically shared across all databases in an installation;
d39 1
a39 1
  <table>
d52 1
a52 2
      <entry><link linkend="catalog-pg-aggregate">
       <database class="table">pg_aggregate</database></link></entry>
d57 1
a57 1
      <entry>pg_am</entry>
d62 1
a62 1
      <entry>pg_amop</entry>
d67 1
a67 1
      <entry>pg_amproc</entry>
d72 1
a72 2
      <entry><link linkend="catalog-pg-attrdef">
       <database class="table">pg_attrdef</database></link></entry>
d77 2
a78 3
      <entry><link linkend="catalog-pg-attribute">
       <database class="table">pg_attribute</database></link></entry>
      <entry>table columns (<quote>attributes</quote>, <quote>fields</quote>)</entry>
d82 1
a82 2
      <entry><link linkend="catalog-pg-cast">
       <database class="table">pg_cast</database></link></entry>
d87 1
a87 2
      <entry><link linkend="catalog-pg-class">
       <database class="table">pg_class</database></link></entry>
d92 2
a93 3
      <entry><link linkend="catalog-pg-constraint">
       <database class="table">pg_constraint</database></link></entry>
      <entry>check constraints, unique / primary key constraints, foreign key constraints</entry>
d97 1
a97 2
      <entry><link linkend="catalog-pg-conversion">
       <database class="table">pg_conversion</database></link></entry>
d102 1
a102 2
      <entry><link linkend="catalog-pg-database">
       <database class="table">pg_database</database></link></entry>
d107 1
a107 2
      <entry><link linkend="catalog-pg-depend">
       <database class="table">pg_depend</database></link></entry>
d112 1
a112 2
      <entry><link linkend="catalog-pg-description">
       <database class="table">pg_description</database></link></entry>
d117 1
a117 2
      <entry><link linkend="catalog-pg-group">
       <database class="table">pg_group</database></link></entry>
d122 1
a122 2
      <entry><link linkend="catalog-pg-index">
       <database class="table">pg_index</database></link></entry>
d127 1
a127 2
      <entry><link linkend="catalog-pg-inherits">
       <database class="table">pg_inherits</database></link></entry>
d132 1
a132 2
      <entry><link linkend="catalog-pg-language">
       <database class="table">pg_language</database></link></entry>
d137 1
a137 2
      <entry><link linkend="catalog-pg-largeobject">
       <database class="table">pg_largeobject</database></link></entry>
d142 2
a143 3
      <entry><link linkend="catalog-pg-listener">
       <database class="table">pg_listener</database></link></entry>
      <entry>asynchronous notification</entry>
d147 2
a148 3
      <entry><link linkend="catalog-pg-namespace">
       <database class="table">pg_namespace</database></link></entry>
      <entry>namespaces (schemas)</entry>
d152 1
a152 2
      <entry><link linkend="catalog-pg-opclass">
       <database class="table">pg_opclass</database></link></entry>
d157 1
a157 2
      <entry><link linkend="catalog-pg-operator">
       <database class="table">pg_operator</database></link></entry>
d162 1
a162 2
      <entry><link linkend="catalog-pg-proc">
       <database class="table">pg_proc</database></link></entry>
d167 2
a168 3
      <entry><link linkend="catalog-pg-rewrite">
       <database class="table">pg_rewrite</database></link></entry>
      <entry>query rewriter rules</entry>
d172 1
a172 2
      <entry><link linkend="catalog-pg-shadow">
       <database class="table">pg_shadow</database></link></entry>
d177 2
a178 3
      <entry><link linkend="catalog-pg-statistic">
       <database class="table">pg_statistic</database></link></entry>
      <entry>optimizer statistics</entry>
d182 1
a182 2
      <entry><link linkend="catalog-pg-trigger">
       <database class="table">pg_trigger</database></link></entry>
d187 1
a187 2
      <entry><link linkend="catalog-pg-type">
       <database class="table">pg_type</database></link></entry>
a192 5

  <para>
   More detailed documentation of each catalog follows below.
  </para>

d197 5
a201 1
  <title>pg_aggregate</title>
d204 1
a204 1
   <structname>pg_aggregate</structname> stores information about
d213 1
a213 1
   entry carries the aggregate's name, input and output datatypes, and
d218 1
a218 1
   <title>pg_aggregate Columns</title>
d231 1
a231 1
      <entry>aggfnoid</entry>
d233 2
a234 2
      <entry>pg_proc.oid</entry>
      <entry>pg_proc OID of the aggregate function</entry>
d237 1
a237 1
      <entry>aggtransfn</entry>
d239 1
a239 1
      <entry>pg_proc.oid</entry>
d243 1
a243 1
      <entry>aggfinalfn</entry>
d245 1
a245 1
      <entry>pg_proc.oid</entry>
d249 1
a249 1
      <entry>aggtranstype</entry>
d251 1
a251 1
      <entry>pg_type.oid</entry>
d255 1
a255 1
      <entry>agginitval</entry>
d261 2
a262 2
       representation.  If the field is NULL, the transition state
       value starts out NULL.
d280 5
a284 1
  <title>pg_am</title>
d287 1
a287 1
   <structname>pg_am</structname> stores information about index access
d293 1
a293 1
   <title>pg_am Columns</title>
d307 1
a307 1
      <entry>amname</entry>
d310 1
a310 1
      <entry>name of the access method</entry>
d314 1
a314 1
      <entry>amowner</entry>
d316 2
a317 2
      <entry>pg_shadow.usesysid</entry>
      <entry>user ID of the owner (currently not used)</entry>
d321 1
a321 1
      <entry>amstrategies</entry>
d324 1
a324 1
      <entry>number of operator strategies for this access method</entry>
d328 1
a328 1
      <entry>amsupport</entry>
d331 1
a331 1
      <entry>number of support routines for this access method</entry>
d335 1
a335 1
      <entry>amorderstrategy</entry>
d338 1
a338 1
      <entry>zero if the index offers no sort order, otherwise the strategy
d343 1
a343 1
      <entry>amcanunique</entry>
d346 1
a346 1
      <entry>does AM support unique indexes?</entry>
d350 1
a350 1
      <entry>amcanmulticol</entry>
d353 1
a353 1
      <entry>does AM support multicolumn indexes?</entry>
d357 1
a357 1
      <entry>amindexnulls</entry>
d360 1
a360 1
      <entry>does AM support NULL index entries?</entry>
d364 1
a364 1
      <entry>amconcurrent</entry>
d367 1
a367 1
      <entry>does AM support concurrent updates?</entry>
d371 1
a371 1
      <entry>amgettuple</entry>
d373 2
a374 2
      <entry>pg_proc.oid</entry>
      <entry><quote>next valid tuple</quote> function</entry>
d378 1
a378 1
      <entry>aminsert</entry>
d380 2
a381 2
      <entry>pg_proc.oid</entry>
      <entry><quote>insert this tuple</quote> function</entry>
d385 1
a385 1
      <entry>ambeginscan</entry>
d387 2
a388 2
      <entry>pg_proc.oid</entry>
      <entry><quote>start new scan</quote> function</entry>
d392 1
a392 1
      <entry>amrescan</entry>
d394 2
a395 2
      <entry>pg_proc.oid</entry>
      <entry><quote>restart this scan</quote> function</entry>
d399 1
a399 1
      <entry>amendscan</entry>
d401 2
a402 2
      <entry>pg_proc.oid</entry>
      <entry><quote>end this scan</quote> function</entry>
d406 1
a406 1
      <entry>ammarkpos</entry>
d408 2
a409 2
      <entry>pg_proc.oid</entry>
      <entry><quote>mark current scan position</quote> function</entry>
d413 1
a413 1
      <entry>amrestrpos</entry>
d415 2
a416 2
      <entry>pg_proc.oid</entry>
      <entry><quote>restore marked scan position</quote> function</entry>
d420 1
a420 1
      <entry>ambuild</entry>
d422 2
a423 2
      <entry>pg_proc.oid</entry>
      <entry><quote>build new index</quote> function</entry>
d427 1
a427 1
      <entry>ambulkdelete</entry>
d429 2
a430 2
      <entry>pg_proc.oid</entry>
      <entry>bulk-delete function</entry>
d434 1
a434 1
      <entry>amvacuumcleanup</entry>
d436 2
a437 2
      <entry>pg_proc.oid</entry>
      <entry>post-VACUUM cleanup function</entry>
d441 1
a441 1
      <entry>amcostestimate</entry>
d443 2
a444 2
      <entry>pg_proc.oid</entry>
      <entry>estimate cost of an indexscan</entry>
d452 1
a452 1
    An index AM that supports multiple columns (has
d454 1
a454 1
    support indexing nulls in columns after the first, because the planner
d456 4
a459 4
    column(s).  For example, consider an index on (a,b) and a query
    WHERE a = 4.  The system will assume the index can be used to scan for
    rows with a = 4, which is wrong if the index omits rows where b is null.
    However it is okay to omit rows where the first indexed column is null.
d462 1
a462 1
    index AM indexes all rows, including arbitrary combinations of nulls.
d469 5
a473 1
  <title>pg_amop</title>
d476 1
a476 1
   <structname>pg_amop</structname> stores information about operators
d482 1
a482 1
   <title>pg_amop Columns</title>
d496 1
a496 1
      <entry>amopclaid</entry>
d498 2
a499 2
      <entry>pg_opclass.oid</entry>
      <entry>the index opclass this entry is for</entry>
d503 1
a503 1
      <entry>amopstrategy</entry>
d506 1
a506 1
      <entry>operator strategy number</entry>
d510 1
a510 1
      <entry>amopreqcheck</entry>
d513 1
a513 1
      <entry>index hit must be rechecked</entry>
d517 1
a517 1
      <entry>amopopr</entry>
d519 2
a520 2
      <entry>pg_operator.oid</entry>
      <entry>the operator's pg_operator OID</entry>
d531 5
a535 1
  <title>pg_amproc</title>
d538 1
a538 1
   <structname>pg_amproc</structname> stores information about support
d545 1
a545 1
   <title>pg_amproc Columns</title>
d559 1
a559 1
      <entry>amopclaid</entry>
d561 2
a562 2
      <entry>pg_opclass.oid</entry>
      <entry>the index opclass this entry is for</entry>
d566 1
a566 1
      <entry>amprocnum</entry>
d569 1
a569 1
      <entry>support procedure index</entry>
d573 1
a573 1
      <entry>amproc</entry>
d575 2
a576 2
      <entry>pg_proc.oid</entry>
      <entry>OID of the proc</entry>
d587 5
a591 1
  <title>pg_attrdef</title>
d594 1
a594 1
   This catalog stores column default values.  The main information
d602 1
a602 1
   <title>pg_attrdef Columns</title>
d616 1
a616 1
      <entry>adrelid</entry>
d618 1
a618 1
      <entry>pg_class.oid</entry>
d623 1
a623 1
      <entry>adnum</entry>
d625 1
a625 1
      <entry>pg_attribute.attnum</entry>
d630 1
a630 1
      <entry>adbin</entry>
d633 1
a633 1
      <entry>An internal representation of the column default value</entry>
d637 1
a637 1
      <entry>adsrc</entry>
d650 5
a654 1
  <title>pg_attribute</title>
d657 1
a657 1
   <structname>pg_attribute</structname> stores information about
d670 1
a670 1
   <title>pg_attribute Columns</title>
d684 1
a684 1
      <entry>attrelid</entry>
d686 1
a686 1
      <entry>pg_class.oid</entry>
d691 1
a691 1
      <entry>attname</entry>
d694 1
a694 1
      <entry>Column name</entry>
d698 1
a698 1
      <entry>atttypid</entry>
d700 1
a700 1
      <entry>pg_type.oid</entry>
d705 1
a705 1
      <entry>attstattarget</entry>
d714 2
a715 2
       The exact meaning of positive values is datatype-dependent.
       For scalar datatypes, <structfield>attstattarget</structfield>
d722 1
a722 1
      <entry>attlen</entry>
d726 2
a727 3
       This is a copy of
       <structname>pg_type</structname>.<structfield>typlen</structfield>
       of this column's type.
d732 1
a732 1
      <entry>attnum</entry>
d743 1
a743 1
      <entry>attndims</entry>
d754 1
a754 1
      <entry>attcacheoff</entry>
d765 1
a765 1
      <entry>atttypmod</entry>
d773 1
a773 1
       The value will generally be -1 for types that do not need typmod.
d778 1
a778 1
      <entry>attbyval</entry>
d782 1
a782 3
       A copy of
       <structname>pg_type</structname>.<structfield>typbyval</structfield>
       of this column's type
d787 1
a787 1
      <entry>attstorage</entry>
d791 2
a792 3
       Normally a copy of
       <structname>pg_type</structname>.<structfield>typstorage</structfield>
       of this column's type.  For TOASTable datatypes, this can be altered
d798 1
a798 1
      <entry>attisset</entry>
d806 1
a806 1
       string that defines this set - i.e., the query to run to get
d816 1
a816 1
      <entry>attalign</entry>
d820 1
a820 3
       A copy of
       <structname>pg_type</structname>.<structfield>typalign</structfield>
       of this column's type
d825 1
a825 1
      <entry>attnotnull</entry>
d829 2
a830 2
       This represents a NOT NULL constraint.  It is possible to
       change this field to enable or disable the constraint.
d835 1
a835 1
      <entry>atthasdef</entry>
d846 1
a846 1
      <entry>attisdropped</entry>
d857 1
a857 1
      <entry>attislocal</entry>
d867 1
a867 1
      <entry>attinhcount</entry>
d883 5
a887 1
  <title>pg_cast</title>
d890 1
a890 1
   <structname>pg_cast</structname> stores data type conversion paths,
d895 1
a895 1
   <title>pg_cast Columns</title>
d909 1
a909 1
      <entry>castsource</entry>
d911 1
a911 1
      <entry>pg_type.oid</entry>
d916 1
a916 1
      <entry>casttarget</entry>
d918 1
a918 1
      <entry>pg_type.oid</entry>
d923 1
a923 1
      <entry>castfunc</entry>
d925 1
a925 1
      <entry>pg_proc.oid</entry>
d928 1
a928 1
       stored if the data types are binary coercible (that is, no
d934 1
a934 1
      <entry>castcontext</entry>
d953 5
a957 1
  <title>pg_class</title>
d960 1
a960 1
   <structname>pg_class</structname> catalogs tables and most
d967 1
a967 1
   fields are meaningful for all relation types.
d971 1
a971 1
   <title>pg_class Columns</title>
d985 1
a985 1
      <entry>relname</entry>
d992 1
a992 1
      <entry>relnamespace</entry>
d994 1
a994 1
      <entry>pg_namespace.oid</entry>
d1001 1
a1001 1
      <entry>reltype</entry>
d1003 1
a1003 1
      <entry>pg_type.oid</entry>
d1006 1
a1006 1
       (zero for indexes, which have no pg_type entry)
d1011 1
a1011 1
      <entry>relowner</entry>
d1013 1
a1013 1
      <entry>pg_shadow.usesysid</entry>
d1018 1
a1018 1
      <entry>relam</entry>
d1020 1
a1020 1
      <entry>pg_am.oid</entry>
d1025 1
a1025 1
      <entry>relfilenode</entry>
d1032 1
a1032 1
      <entry>relpages</entry>
d1045 1
a1045 1
      <entry>reltuples</entry>
d1057 1
a1057 1
      <entry>reltoastrelid</entry>
d1059 1
a1059 1
      <entry>pg_class.oid</entry>
d1068 1
a1068 1
      <entry>reltoastidxid</entry>
d1070 1
a1070 1
      <entry>pg_class.oid</entry>
d1077 1
a1077 1
      <entry>relhasindex</entry>
d1084 1
a1084 1
       <command>VACUUM</command> clears relhasindex if it finds the
d1090 1
a1090 1
      <entry>relisshared</entry>
d1099 1
a1099 1
      <entry>relkind</entry>
d1103 4
a1106 2
       'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
       'c' = composite type, 's' = special, 't' = TOAST table
d1111 1
a1111 1
      <entry>relnatts</entry>
d1115 2
a1116 2
       Number of user columns in the relation (system columns not counted).
       There must be this many corresponding entries in
d1118 1
a1118 1
       <structname>pg_attribute</structname>.<structfield>attnum</structfield>.
d1123 1
a1123 1
      <entry>relchecks</entry>
d1133 1
a1133 1
      <entry>reltriggers</entry>
d1143 1
a1143 1
      <entry>relukeys</entry>
d1146 1
a1146 1
      <entry>unused  (<emphasis>Not</emphasis> the number of unique keys)</entry>
d1150 1
a1150 1
      <entry>relfkeys</entry>
d1153 1
a1153 1
      <entry>unused  (<emphasis>Not</emphasis> the number of foreign keys on the table)</entry>
d1157 1
a1157 1
      <entry>relrefs</entry>
d1164 1
a1164 1
      <entry>relhasoids</entry>
d1173 1
a1173 1
      <entry>relhaspkey</entry>
d1182 1
a1182 1
      <entry>relhasrules</entry>
d1191 1
a1191 1
      <entry>relhassubclass</entry>
d1198 1
a1198 1
      <entry>relacl</entry>
d1202 1
a1202 1
       Access permissions.  See the descriptions of
d1213 5
a1217 1
  <title>pg_constraint</title>
d1220 5
a1224 5
   This system catalog stores CHECK, PRIMARY KEY, UNIQUE, and FOREIGN KEY
   constraints on tables.  (Column
   constraints are not treated specially.  Every column constraint is
   equivalent to some table constraint.)  See under <command>CREATE
   TABLE</command> for more information.
a1226 7
  <note>
   <para>
    NOT NULL constraints are represented in the <structname>pg_attribute</>
    catalog.
   </para>
  </note>

d1228 1
a1228 2
   CHECK constraints on domains are stored here, too.  Global ASSERTIONS
   (a currently-unsupported SQL feature) may someday appear here as well.
d1232 1
a1232 1
   <title>pg_constraint Columns</title>
d1246 1
a1246 1
      <entry>conname</entry>
d1253 1
a1253 1
      <entry>connamespace</entry>
d1255 1
a1255 1
      <entry>pg_namespace.oid</entry>
d1262 1
a1262 1
      <entry>contype</entry>
d1266 4
a1269 4
        'c' = check constraint,
        'f' = foreign key constraint,
        'p' = primary key constraint,
        'u' = unique constraint
d1274 2
a1275 2
      <entry>condeferrable</entry>
      <entry><type>boolean</type></entry>
d1281 2
a1282 2
      <entry>condeferred</entry>
      <entry><type>boolean</type></entry>
d1288 1
a1288 1
      <entry>conrelid</entry>
d1290 1
a1290 1
      <entry>pg_class.oid</entry>
d1295 1
a1295 1
      <entry>contypid</entry>
d1297 1
a1297 1
      <entry>pg_type.oid</entry>
d1302 1
a1302 1
      <entry>confrelid</entry>
d1304 1
a1304 1
      <entry>pg_class.oid</entry>
d1309 1
a1309 1
      <entry>confupdtype</entry>
d1316 1
a1316 1
      <entry>confdeltype</entry>
d1323 1
a1323 1
      <entry>confmatchtype</entry>
d1330 1
a1330 1
      <entry>conkey</entry>
d1332 1
a1332 1
      <entry>pg_attribute.attnum</entry>
d1337 1
a1337 1
      <entry>confkey</entry>
d1339 1
a1339 1
      <entry>pg_attribute.attnum</entry>
d1344 1
a1344 1
      <entry>conbin</entry>
d1351 1
a1351 1
      <entry>consrc</entry>
d1362 3
a1364 3
    <structname>pg_class</structname>.<structfield>relchecks</structfield>
    needs to agree with the number of check-constraint entries found in this
    table for the given relation.
d1371 5
a1375 1
  <title>pg_conversion</title>
d1378 1
a1378 1
   This system catalog stores encoding conversion information. See
d1383 1
a1383 1
   <title>pg_conversion Columns</title>
d1397 1
a1397 1
      <entry>conname</entry>
d1404 1
a1404 1
      <entry>connamespace</entry>
d1406 1
a1406 1
      <entry>pg_namespace.oid</entry>
d1413 1
a1413 1
      <entry>conowner</entry>
d1415 2
a1416 2
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the namespace</entry>
d1420 1
a1420 1
      <entry>conforencoding</entry>
d1423 1
a1423 1
      <entry>Source(for) encoding ID</entry>
d1427 1
a1427 1
      <entry>contoencoding</entry>
d1430 1
a1430 1
      <entry>Destination(to) encoding ID</entry>
d1434 1
a1434 1
      <entry>conproc</entry>
d1436 1
a1436 1
      <entry>pg_proc.oid</entry>
d1441 2
a1442 2
      <entry>condefault</entry>
      <entry><type>boolean</type></entry>
d1444 1
a1444 1
      <entry>true if this is the default conversion</entry>
d1454 5
a1458 1
  <title>pg_database</title>
d1461 1
a1461 1
   The <structname>pg_database</structname> catalog stores information
d1476 1
a1476 1
   <title>pg_database Columns</title>
d1490 1
a1490 1
      <entry>datname</entry>
d1497 1
a1497 1
      <entry>datdba</entry>
d1499 1
a1499 1
      <entry>pg_shadow.usesysid</entry>
d1504 1
a1504 1
      <entry>encoding</entry>
d1507 1
a1507 1
      <entry>Character/multibyte encoding for this database</entry>
d1511 1
a1511 1
      <entry>datistemplate</entry>
d1516 1
a1516 1
       <quote>TEMPLATE</quote> clause of <command>CREATE
d1523 1
a1523 1
      <entry>datallowconn</entry>
d1528 1
a1528 1
       used to protect the template0 database from being altered.
d1533 1
a1533 1
      <entry>datlastsysoid</entry>
d1543 1
a1543 1
      <entry>datvacuumxid</entry>
d1554 1
a1554 1
      <entry>datfrozenxid</entry>
d1561 1
a1561 1
       soon to avoid transaction ID wraparound problems.
d1566 1
a1566 1
      <entry>datpath</entry>
d1577 1
a1577 1
      <entry>datconfig</entry>
d1584 1
a1584 1
      <entry>datacl</entry>
d1587 1
a1587 1
      <entry>Access permissions</entry>
d1596 5
a1600 1
  <title>pg_depend</title>
d1603 1
a1603 1
   The <structname>pg_depend</structname> table records the dependency
d1606 1
a1606 1
   by <command>DROP CASCADE</>, or prevent dropping in the <command>DROP
d1611 1
a1611 1
   <title>pg_depend Columns</title>
d1625 1
a1625 1
      <entry>classid</entry>
d1627 2
a1628 2
      <entry>pg_class.oid</entry>
      <entry>The oid of the system catalog the dependent object is in</entry>
d1632 1
a1632 1
      <entry>objid</entry>
d1634 2
a1635 2
      <entry>any oid attribute</entry>
      <entry>The oid of the specific dependent object</entry>
d1639 1
a1639 1
      <entry>objsubid</entry>
d1642 5
a1646 3
      <entry>For a table attribute, this is the attribute's
       column number (the objid and classid refer to the table itself).
       For all other object types, this field is presently zero.
d1651 1
a1651 1
      <entry>refclassid</entry>
d1653 2
a1654 2
      <entry>pg_class.oid</entry>
      <entry>The oid of the system catalog the referenced object is in</entry>
d1658 1
a1658 1
      <entry>refobjid</entry>
d1661 1
a1661 1
      <entry>The oid of the specific referenced object</entry>
d1665 1
a1665 1
      <entry>refobjsubid</entry>
d1668 5
a1672 3
      <entry>For a table attribute, this is the attribute's
       column number (the refobjid and refclassid refer to the table itself).
       For all other object types, this field is presently zero.
d1677 1
a1677 1
      <entry>deptype</entry>
d1681 1
a1681 1
       A code defining the specific semantics of this dependency relationship.
d1695 61
a1755 46
   <itemizedlist>
    <listitem>
     <para>
      DEPENDENCY_NORMAL ('n'): normal relationship between separately-created
      objects.  The dependent object may be dropped without affecting the
      referenced object.  The referenced object may only be dropped by
      specifying CASCADE, in which case the dependent object is dropped too.
      Example: a table column has a normal dependency on its datatype.
     </para>
    </listitem>

    <listitem>
     <para>
      DEPENDENCY_AUTO ('a'): the dependent object can be dropped separately
      from the referenced object, and should be automatically dropped
      (regardless of RESTRICT or CASCADE mode) if the referenced object
      is dropped.
      Example: a named constraint on a table is made auto-dependent on
      the table, so that it will go away if the table is dropped.
     </para>
    </listitem>

    <listitem>
     <para>
      DEPENDENCY_INTERNAL ('i'): the dependent object was created as part
      of creation of the referenced object, and is really just a part of
      its internal implementation.  A DROP of the dependent object will be
      disallowed outright (we'll tell the user to issue a DROP against the
      referenced object, instead).  A DROP of the referenced object will be
      propagated through to drop the dependent object whether CASCADE is
      specified or not.
      Example: a trigger that's created to enforce a foreign-key constraint
      is made internally dependent on the constraint's pg_constraint entry.
     </para>
    </listitem>

    <listitem>
     <para>
      DEPENDENCY_PIN ('p'): there is no dependent object; this type of entry
      is a signal that the system itself depends on the referenced object,
      and so that object must never be deleted.  Entries of this type are
      created only during initdb.  The fields for the dependent object
      contain zeroes.
     </para>
    </listitem>
   </itemizedlist>
d1764 5
a1768 1
  <title>pg_description</title>
d1771 1
a1771 1
   The pg_description table can store an optional description or
d1776 1
a1776 1
   contents of pg_description.
d1780 1
a1780 1
   <title>pg_description Columns</title>
d1794 1
a1794 1
      <entry>objoid</entry>
d1796 2
a1797 2
      <entry>any oid attribute</entry>
      <entry>The oid of the object this description pertains to</entry>
d1801 1
a1801 1
      <entry>classoid</entry>
d1803 2
a1804 2
      <entry>pg_class.oid</entry>
      <entry>The oid of the system catalog this object appears in</entry>
d1808 1
a1808 1
      <entry>objsubid</entry>
d1811 5
a1815 3
      <entry>For a comment on a table attribute, this is the attribute's
       column number (the objoid and classoid refer to the table itself).
       For all other object types, this field is presently zero.
d1820 1
a1820 1
      <entry>description</entry>
d1833 5
a1837 1
  <title>pg_group</title>
d1840 1
a1840 1
   This catalog defines groups and stores what users belong to what
d1843 1
a1843 1
   about user permission management.
d1855 1
a1855 1
   <title>pg_group Columns</title>
d1869 1
a1869 1
      <entry>groname</entry>
d1876 1
a1876 1
      <entry>grosysid</entry>
d1883 1
a1883 1
      <entry>grolist</entry>
d1885 2
a1886 2
      <entry>pg_shadow.usesysid</entry>
      <entry>An array containing the ids of the users in this group</entry>
d1896 5
a1900 1
  <title>pg_index</title>
d1903 1
a1903 1
   <structname>pg_index</structname> contains part of the information
d1909 1
a1909 1
   <title>pg_index Columns</title>
d1923 1
a1923 1
      <entry>indexrelid</entry>
d1925 2
a1926 2
      <entry>pg_class.oid</entry>
      <entry>The OID of the pg_class entry for this index</entry>
d1930 1
a1930 1
      <entry>indrelid</entry>
d1932 2
a1933 2
      <entry>pg_class.oid</entry>
      <entry>The OID of the pg_class entry for the table this index is for</entry>
d1937 1
a1937 1
      <entry>indproc</entry>
d1939 1
a1939 1
      <entry>pg_proc.oid</entry>
d1945 1
a1945 1
      <entry>indkey</entry>
d1949 1
a1949 1
       This is a vector (array) of up to
d1960 1
a1960 1
      <entry>indclass</entry>
d1965 1
a1965 1
       the <quote>operator class</quote> to use.  See
d1971 1
a1971 1
      <entry>indisclustered</entry>
d1978 1
a1978 1
      <entry>indisunique</entry>
d1985 1
a1985 1
      <entry>indisprimary</entry>
d1989 1
a1989 1
      (indisunique should always be true when this is true.)</entry>
d1993 1
a1993 1
      <entry>indreference</entry>
d2000 1
a2000 1
      <entry>indpred</entry>
d2003 1
a2003 1
      <entry>Expression tree (in the form of a nodeToString representation)
d2015 5
a2019 1
  <title>pg_inherits</title>
d2022 2
a2023 1
   This catalog records information about table inheritance hierarchies.
d2027 1
a2027 1
   <title>pg_inherits Columns</title>
d2041 1
a2041 1
      <entry>inhrelid</entry>
d2043 1
a2043 1
      <entry>pg_class.oid</entry>
d2050 1
a2050 1
      <entry>inhparent</entry>
d2052 1
a2052 1
      <entry>pg_class.oid</entry>
d2059 1
a2059 1
      <entry>inhseqno</entry>
d2076 5
a2080 1
  <title>pg_language</title>
d2083 1
a2083 1
   <structname>pg_language</structname> registers call interfaces or
d2086 1
a2086 1
   <xref linkend="server-programming"> for more information about language handlers.
d2090 1
a2090 1
   <title>pg_language Columns</title>
d2104 1
a2104 1
      <entry>lanname</entry>
d2111 1
a2111 1
      <entry>lanispl</entry>
d2124 1
a2124 1
      <entry>lanpltrusted</entry>
d2131 1
a2131 1
       this field is meaningless.
d2136 1
a2136 1
      <entry>lanplcallfoid</entry>
d2138 1
a2138 1
      <entry>pg_proc.oid</entry>
d2140 1
a2140 1
       For non-internal languages this references the language
d2148 1
a2148 1
      <entry>lanvalidator</entry>
d2150 1
a2150 1
      <entry>pg_proc.oid</entry>
d2160 1
a2160 1
      <entry>lanacl</entry>
d2163 1
a2163 1
      <entry>Access permissions</entry>
d2173 5
a2177 1
  <title>pg_largeobject</title>
d2180 1
a2180 1
   <structname>pg_largeobject</structname> holds the data making up
d2185 2
a2186 2
   The amount of data per page is defined to be LOBLKSIZE (which is currently
   BLCKSZ/4, or typically 2Kbytes).
d2190 1
a2190 1
   <title>pg_largeobject Columns</title>
d2204 1
a2204 1
      <entry>loid</entry>
d2211 1
a2211 1
      <entry>pageno</entry>
d2219 1
a2219 1
      <entry>data</entry>
d2224 1
a2224 1
       This will never be more than LOBLKSIZE bytes, and may be less.
d2234 1
a2234 1
   byte offset (pageno * LOBLKSIZE) within the object.  The implementation
d2236 1
a2236 1
   LOBLKSIZE bytes even if they are not the last page of the object.
d2244 5
a2248 1
  <title>pg_listener</title>
d2251 1
a2251 1
   <structname>pg_listener</structname> supports the <command>LISTEN</>
d2261 1
a2261 1
   <title>pg_listener Columns</title>
d2275 1
a2275 1
      <entry>relname</entry>
d2279 1
a2279 1
      relation in the database; the term <quote>relname</> is historical.)
d2284 1
a2284 1
      <entry>listenerpid</entry>
d2287 1
a2287 1
      <entry>PID of the backend process that created this entry.</entry>
d2291 1
a2291 1
      <entry>notification</entry>
d2296 1
a2296 1
       pending, the PID of the backend that sent the notification.
d2307 5
a2311 1
  <title>pg_namespace</title>
d2314 3
a2316 2
   A namespace is the structure underlying SQL92 schemas: each namespace
   can have a separate collection of relations, types, etc without name
d2321 1
a2321 1
   <title>pg_namespace Columns</title>
d2335 1
a2335 1
      <entry>nspname</entry>
d2342 1
a2342 1
      <entry>nspowner</entry>
d2344 2
a2345 2
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the namespace</entry>
d2349 1
a2349 1
      <entry>nspacl</entry>
d2352 1
a2352 1
      <entry>Access permissions</entry>
d2362 5
a2366 1
  <title>pg_opclass</title>
d2369 1
a2369 1
   <structname>pg_opclass</structname> defines
d2371 1
a2371 1
   semantics for index columns of a particular datatype and a particular
d2373 1
a2373 1
   for a given datatype/access method combination, thus supporting multiple
d2378 1
a2378 1
   Operator classes are described at length in <xref linkend="server-programming">.
d2382 1
a2382 1
   <title>pg_opclass Columns</title>
d2396 1
a2396 1
      <entry>opcamid</entry>
d2398 2
a2399 2
      <entry>pg_am.oid</entry>
      <entry>index access method opclass is for</entry>
d2403 1
a2403 1
      <entry>opcname</entry>
d2406 1
a2406 1
      <entry>name of this opclass</entry>
d2410 1
a2410 1
      <entry>opcnamespace</entry>
d2412 2
a2413 2
      <entry>pg_namespace.oid</entry>
      <entry>namespace of this opclass</entry>
d2417 1
a2417 1
      <entry>opcowner</entry>
d2419 2
a2420 2
      <entry>pg_shadow.usesysid</entry>
      <entry>opclass owner</entry>
d2424 1
a2424 1
      <entry>opcintype</entry>
d2426 2
a2427 2
      <entry>pg_type.oid</entry>
      <entry>type of input data for opclass</entry>
d2431 1
a2431 1
      <entry>opcdefault</entry>
d2434 1
a2434 1
      <entry>true if opclass is default for opcintype</entry>
d2438 1
a2438 1
      <entry>opckeytype</entry>
d2440 2
a2441 2
      <entry>pg_type.oid</entry>
      <entry>type of index data, or zero if same as opcintype</entry>
d2455 1
a2455 1
   row, plus associated rows in <structname>pg_attribute</structname> and
d2463 5
a2467 1
  <title>pg_operator</title>
d2470 3
a2472 2
   See <command>CREATE OPERATOR</command> and <xref linkend="xoper">
   for details on these operator parameters.
d2476 1
a2476 1
   <title>pg_operator Columns</title>
d2490 1
a2490 1
      <entry>oprname</entry>
d2497 1
a2497 1
      <entry>oprnamespace</entry>
d2499 1
a2499 1
      <entry>pg_namespace.oid</entry>
d2506 1
a2506 1
      <entry>oprowner</entry>
d2508 2
a2509 2
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the operator</entry>
d2513 1
a2513 1
      <entry>oprkind</entry>
d2517 2
a2518 2
       'b' = infix (<quote>both</quote>), 'l' = prefix
       (<quote>left</quote>), 'r' = postfix (<quote>right</quote>)
d2523 1
a2523 1
      <entry>oprcanhash</entry>
d2530 1
a2530 1
      <entry>oprleft</entry>
d2532 1
a2532 1
      <entry>pg_type.oid</entry>
d2537 1
a2537 1
      <entry>oprright</entry>
d2539 1
a2539 1
      <entry>pg_type.oid</entry>
d2544 1
a2544 1
      <entry>oprresult</entry>
d2546 1
a2546 1
      <entry>pg_type.oid</entry>
d2551 1
a2551 1
      <entry>oprcom</entry>
d2553 1
a2553 1
      <entry>pg_operator.oid</entry>
d2558 1
a2558 1
      <entry>oprnegate</entry>
d2560 1
a2560 1
      <entry>pg_operator.oid</entry>
d2565 1
a2565 1
      <entry>oprlsortop</entry>
d2567 1
a2567 1
      <entry>pg_operator.oid</entry>
d2575 1
a2575 1
      <entry>oprrsortop</entry>
d2577 1
a2577 1
      <entry>pg_operator.oid</entry>
d2585 1
a2585 1
      <entry>oprltcmpop</entry>
d2587 1
a2587 1
      <entry>pg_operator.oid</entry>
d2595 1
a2595 1
      <entry>oprgtcmpop</entry>
d2597 1
a2597 1
      <entry>pg_operator.oid</entry>
d2605 1
a2605 1
      <entry>oprcode</entry>
d2607 1
a2607 1
      <entry>pg_proc.oid</entry>
d2612 1
a2612 1
      <entry>oprrest</entry>
d2614 1
a2614 1
      <entry>pg_proc.oid</entry>
d2619 1
a2619 1
      <entry>oprjoin</entry>
d2621 1
a2621 1
      <entry>pg_proc.oid</entry>
d2629 1
a2629 1
   Unused fields contain zeroes, for example oprleft is zero for a
d2637 5
a2641 1
  <title>pg_proc</title>
d2644 1
a2644 1
   This catalog stores information about functions (or procedures).
d2647 1
a2647 1
   some fields.
d2653 1
a2653 1
   row in <structname>pg_aggregate</structname>.
d2657 1
a2657 1
   <title>pg_proc Columns</title>
d2671 1
a2671 1
      <entry>proname</entry>
d2678 1
a2678 1
      <entry>pronamespace</entry>
d2680 1
a2680 1
      <entry>pg_namespace.oid</entry>
d2687 1
a2687 1
      <entry>proowner</entry>
d2689 2
a2690 2
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the function</entry>
d2694 1
a2694 1
      <entry>prolang</entry>
d2696 1
a2696 1
      <entry>pg_language.oid</entry>
d2701 1
a2701 1
      <entry>proisagg</entry>
d2708 1
a2708 1
      <entry>prosecdef</entry>
d2716 1
a2716 1
      <entry>proisstrict</entry>
d2728 1
a2728 1
      <entry>proretset</entry>
d2731 1
a2731 1
      <entry>Function returns a set (ie, multiple values of the specified
d2736 1
a2736 1
      <entry>provolatile</entry>
d2755 1
a2755 1
      <entry>pronargs</entry>
d2762 1
a2762 1
      <entry>prorettype</entry>
d2764 1
a2764 1
      <entry>pg_type.oid</entry>
d2769 1
a2769 1
      <entry>proargtypes</entry>
d2771 2
a2772 2
      <entry>pg_type.oid</entry>
      <entry>A vector with the data types of the function arguments</entry>
d2776 1
a2776 1
      <entry>prosrc</entry>
d2788 1
a2788 1
      <entry>probin</entry>
d2797 1
a2797 1
      <entry>proacl</entry>
d2800 1
a2800 1
      <entry>Access permissions</entry>
d2807 7
a2813 9
  Currently, prosrc contains the function's C-language name (link symbol)
  for compiled functions, both built-in and dynamically loaded.  For all
  other language types, prosrc contains the function's source text.
  </para>

  <para>
  Currently, probin is unused except for dynamically-loaded C functions,
  for which it gives the name of the shared library file containing the
  function.
d2819 5
a2823 1
  <title>pg_rewrite</title>
d2826 1
a2826 1
   This system catalog stores rewrite rules for tables and views.
d2830 1
a2830 1
   <title>pg_rewrite Columns</title>
d2844 1
a2844 1
      <entry>rulename</entry>
d2851 1
a2851 1
      <entry>ev_class</entry>
d2853 1
a2853 1
      <entry>pg_class.oid</entry>
d2858 1
a2858 1
      <entry>ev_attr</entry>
d2866 1
a2866 1
      <entry>ev_type</entry>
d2869 5
a2873 2
      <entry>Event type that the rule is for: '1' = SELECT,
      '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry>
d2877 1
a2877 1
      <entry>is_instead</entry>
d2880 1
a2880 1
      <entry>True if the rule is an INSTEAD rule</entry>
d2884 1
a2884 1
      <entry>ev_qual</entry>
d2887 5
a2891 2
      <entry>Expression tree (in the form of a nodeToString representation)
      for the rule's qualifying condition</entry>
d2895 1
a2895 1
      <entry>ev_action</entry>
d2898 5
a2902 2
      <entry>Query tree (in the form of a nodeToString representation)
      for the rule's action</entry>
d2910 1
a2910 1
    <structname>pg_class</structname>.<structfield>relhasrules</structfield>
d2919 5
a2923 1
  <title>pg_shadow</title>
d2926 1
a2926 1
   <structname>pg_shadow</structname> contains information about
d2929 2
a2930 2
   <structname>pg_user</structname> is a publicly readable view on
   <structname>pg_shadow</structname> that blanks out the password field.
d2935 1
a2935 1
   permission management.
d2947 1
a2947 1
   <title>pg_shadow Columns</title>
d2961 1
a2961 1
      <entry>usename</entry>
d2968 1
a2968 1
      <entry>usesysid</entry>
d2975 1
a2975 1
      <entry>usecreatedb</entry>
d2982 1
a2982 1
      <entry>usesuper</entry>
d2989 1
a2989 1
      <entry>usecatupd</entry>
d2994 1
a2994 1
       this unless this attribute is true.)
d2999 1
a2999 1
      <entry>passwd</entry>
d3006 1
a3006 1
      <entry>valuntil</entry>
d3013 1
a3013 1
      <entry>useconfig</entry>
d3026 5
a3030 1
  <title>pg_statistic</title>
d3033 1
a3033 1
   <structname>pg_statistic</structname> stores statistical data about
d3045 1
a3045 1
   extremely general statistics (such as NULL-ness) are given dedicated
d3068 1
a3068 1
   <title>pg_statistic Columns</title>
d3082 1
a3082 1
      <entry>starelid</entry>
d3084 1
a3084 1
      <entry>pg_class.oid</entry>
d3089 1
a3089 1
      <entry>staattnum</entry>
d3091 1
a3091 1
      <entry>pg_attribute.attnum</entry>
d3096 1
a3096 1
      <entry>stanullfrac</entry>
d3099 1
a3099 1
      <entry>The fraction of the column's entries that are NULL</entry>
d3103 1
a3103 1
      <entry>stawidth</entry>
d3106 1
a3106 1
      <entry>The average stored width, in bytes, of non-NULL entries</entry>
d3110 1
a3110 1
      <entry>stadistinct</entry>
d3113 1
a3113 1
      <entry>The number of distinct non-NULL data values in the column.
d3117 1
a3117 1
      twice on the average could be represented by stadistinct = -0.5).
d3123 1
a3123 1
      <entry>stakindN</entry>
d3126 4
a3129 2
      <entry>A code number indicating the kind of statistics stored in the Nth
      <quote>slot</quote> of the <structname>pg_statistic</structname> row.
d3134 1
a3134 1
      <entry>staopN</entry>
d3136 6
a3141 4
      <entry>pg_operator.oid</entry>
      <entry>An operator used to derive the statistics stored in the
      Nth <quote>slot</quote>.  For example, a histogram slot would show the <literal>&lt;</literal>
      operator that defines the sort order of the data.
d3146 1
a3146 1
      <entry>stanumbersN</entry>
d3149 4
a3152 2
      <entry>Numerical statistics of the appropriate kind for the Nth
      <quote>slot</quote>, or NULL if the slot kind does not involve numerical values.
d3157 1
a3157 1
      <entry>stavaluesN</entry>
d3160 7
a3166 6
      <entry>Column data values of the appropriate kind for the Nth
      <quote>slot</quote>, or NULL if the slot kind does not store any data
      values.
      Each array's element values are actually of the specific column's
      datatype, so there is no way to define these columns' type more
      specifically than <quote>anyarray</>.
d3177 5
a3181 1
  <title>pg_trigger</title>
d3184 1
a3184 1
   This system catalog stores triggers on tables.  See under
d3189 1
a3189 1
   <title>pg_trigger Columns</title>
d3203 1
a3203 1
      <entry>tgrelid</entry>
d3205 1
a3205 1
      <entry>pg_class.oid</entry>
d3210 1
a3210 1
      <entry>tgname</entry>
d3217 1
a3217 1
      <entry>tgfoid</entry>
d3219 1
a3219 1
      <entry>pg_proc.oid</entry>
d3224 1
a3224 1
      <entry>tgtype</entry>
d3231 1
a3231 1
      <entry>tgenabled</entry>
d3240 1
a3240 1
      <entry>tgisconstraint</entry>
d3243 1
a3243 1
      <entry>True if trigger implements an RI constraint</entry>
d3247 1
a3247 1
      <entry>tgconstrname</entry>
d3250 1
a3250 1
      <entry>RI constraint name</entry>
d3254 1
a3254 1
      <entry>tgconstrrelid</entry>
d3256 2
a3257 2
      <entry>pg_class.oid</entry>
      <entry>The table referenced by an RI constraint</entry>
d3261 1
a3261 1
      <entry>tgdeferrable</entry>
d3268 1
a3268 1
      <entry>tginitdeferred</entry>
d3275 1
a3275 1
      <entry>tgnargs</entry>
d3282 1
a3282 1
      <entry>tgattr</entry>
d3289 1
a3289 1
      <entry>tgargs</entry>
d3300 2
a3301 2
    <structname>pg_class</structname>.<structfield>reltriggers</structfield>
    needs to match up with the entries in this table.
d3309 5
a3313 1
  <title>pg_type</title>
d3316 2
a3317 2
   This catalog stores information about data types.  Scalar types
   (<quote>base types</>) are created with <command>CREATE TYPE</command>.
d3320 1
a3320 1
   complex types with <command>CREATE TYPE AS</command>, and
d3325 1
a3325 1
   <title>pg_type Columns</title>
d3339 1
a3339 1
      <entry>typname</entry>
d3346 1
a3346 1
      <entry>typnamespace</entry>
d3348 1
a3348 1
      <entry>pg_namespace.oid</entry>
d3355 1
a3355 1
      <entry>typowner</entry>
d3357 2
a3358 2
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the type</entry>
d3362 1
a3362 1
      <entry>typlen</entry>
d3375 1
a3375 1
      <entry>typbyval</entry>
d3395 1
a3395 1
      <entry>typtype</entry>
d3409 1
a3409 1
      <entry>typisdefined</entry>
d3412 5
a3416 3
      <entry>True if the type is defined, false if this is a placeholder
      entry for a not-yet-defined type.  When typisdefined is false,
      nothing except the type name, namespace, and OID can be relied on.
d3421 1
a3421 1
      <entry>typdelim</entry>
d3430 1
a3430 1
      <entry>typrelid</entry>
d3432 1
a3432 1
      <entry>pg_class.oid</entry>
d3435 1
a3435 1
       <structfield>typtype</structfield>), then this field points to
d3441 1
a3441 1
       Zero for non-complex types.
d3446 1
a3446 1
      <entry>typelem</entry>
d3448 1
a3448 1
      <entry>pg_type.oid</entry>
d3460 1
a3460 1
       its internal representation must be N values of the
d3468 1
a3468 1
      <entry>typinput</entry>
d3470 1
a3470 1
      <entry>pg_proc.oid</entry>
d3475 1
a3475 1
      <entry>typoutput</entry>
d3477 1
a3477 1
      <entry>pg_proc.oid</entry>
d3482 1
a3482 1
      <entry>typalign</entry>
d3500 1
a3500 1
         <para>'c' = CHAR alignment, i.e., no alignment needed.</para>
d3503 1
a3503 1
         <para>'s' = SHORT alignment (2 bytes on most machines).</para>
d3506 1
a3506 1
         <para>'i' = INT alignment (4 bytes on most machines).</para>
d3509 1
a3509 1
         <para>'d' = DOUBLE alignment (8 bytes on many machines, but by no means all).</para>
d3516 1
a3516 1
        agree with the way that the compiler will lay out the field in
d3523 1
a3523 1
      <entry>typstorage</entry>
d3534 1
a3534 1
         <para>'p': Value must always be stored plain.</para>
d3538 1
a3538 1
          'e': Value can be stored in a <quote>secondary</quote>
d3540 1
a3540 1
          <structname>pg_class</structname>.<structfield>reltoastrelid</structfield>).
d3544 1
a3544 1
         <para>'m': Value can be stored compressed inline.</para>
d3547 1
a3547 1
         <para>'x': Value can be stored compressed inline or in <quote>secondary</quote>.</para>
d3550 2
a3551 2
       Note that 'm' fields can also be moved out to secondary
       storage, but only as a last resort ('e' and 'x' fields are
d3557 1
a3557 1
      <entry>typnotnull</entry>
d3561 2
a3562 2
       <structfield>typnotnull</structfield> represents a NOT NULL
       constraint on a type.  Presently used for domains only.
d3567 1
a3567 1
      <entry>typbasetype</entry>
d3569 1
a3569 1
      <entry>pg_type.oid</entry>
d3578 1
a3578 1
      <entry>typtypmod</entry>
d3582 1
a3582 1
       Domains use <structfield>typtypmod</structfield> to record the typmod
d3584 1
a3584 1
       typmod).  -1 if this type is not a domain.
d3589 1
a3589 1
      <entry>typndims</entry>
d3596 1
a3596 1
       Zero for non-domains and non-array domains.
d3601 1
a3601 1
      <entry>typdefaultbin</entry>
d3605 2
a3606 2
       If <structfield>typdefaultbin</> is not NULL, it is the nodeToString
       representation of a default expression for the type.  Currently this is
d3612 1
a3612 1
      <entry>typdefault</entry>
d3616 2
a3617 2
       <structfield>typdefault</> is NULL if the type has no associated
       default value. If <structfield>typdefaultbin</> is not NULL,
d3620 1
a3620 1
       <structfield>typdefaultbin</> is NULL and <structfield>typdefault</> is
@


2.67
log
@Instead of storing pg_statistic stavalues entries as text strings, store
them as arrays of the internal datatype.  This requires treating the
stavalues columns as 'anyarray' rather than 'text[]', which is not 100%
kosher but seems to work fine for the purposes we need for pg_statistic.
Perhaps in the future 'anyarray' will be allowed more generally.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.66 2003/02/22 00:45:03 tgl Exp $
d291 1
a291 1
   AGGREGATE</command> command.  See the &cite-programmer; for more
d1455 2
a1456 2
   <command>CREATE DATABASE</command> command.  Consult the
   &cite-admin; for details about the meaning of some of the
d1801 1
a1801 1
   GROUP</command> command.  Consult the &cite-admin; for information
d2031 2
a2032 2
   See under <command>CREATE LANGUAGE</command> and in the
   &cite-programmer; for more information about language handlers.
d2307 1
a2307 1
   Operator classes are described at length in the &cite-programmer;.
d2395 1
a2395 1
   See <command>CREATE OPERATOR</command> and the &cite-programmer;
d2565 2
a2566 2
   The description of <command>CREATE FUNCTION</command> and the
   &cite-programmer; contain more information about the meaning of
d2839 1
a2839 1
   The &cite-admin; contains detailed information about user and
@


2.66
log
@More infrastructure for btree compaction project.  Tree-traversal code
now knows what to do upon hitting a dead page (in theory anyway, it's
untested...).  Add a post-VACUUM-cleanup entry point for index AMs, to
provide a place for dead-page scavenging to happen.
Also, fix oversight that broke btpo_prev links in temporary indexes.
initdb forced due to additions in pg_am.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.65 2003/01/19 00:13:28 momjian Exp $
d3053 1
a3053 1
      <entry><type>text[]</type></entry>
d3056 5
a3060 3
      <quote>slot</quote>, or NULL if the slot kind does not store any data values.
      For data-type independence, all column data values are converted
      to external textual form and stored as TEXT datums.
@


2.65
log
@This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.64 2002/12/17 17:41:30 momjian Exp $
d447 7
@


2.64
log
@Improvement to CREATE TRIGGER and catalog documentation.

Neil Conway
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.63 2002/10/14 04:29:23 momjian Exp $
d291 3
a293 3
   AGGREGATE</command> command.  See the <citetitle>Programmer's
   Guide</citetitle> for more information about writing aggregate
   functions and the meaning of the transition functions, etc.
d1449 2
a1450 2
   <citetitle>Administrator's Guide</citetitle> for details about the
   meaning of some of the parameters.
d1794 2
a1795 2
   GROUP</command> command.  Consult the <citetitle>Administrator's
   Guide</citetitle> for information about user permission management.
d2025 1
a2025 2
   <citetitle>Programmer's Guide</citetitle> for more information
   about language handlers.
d2300 1
a2300 2
   Operator classes are described at length in the
   <citetitle>Programmer's Guide</citetitle>.
d2388 2
a2389 3
   See <command>CREATE OPERATOR</command> and the
   <citetitle>Programmer's Guide</citetitle> for details on these
   operator parameters.
d2559 2
a2560 2
   <citetitle>Programmer's Guide</citetitle> contain more information
   about the meaning of some fields.
d2832 2
a2833 2
   The <citetitle>Administrator's Guide</citetitle> contains detailed
   information about user and permission management.
@


2.63
log
@- Link the entries in the table to the catalog heading
- Wrap them in the <database class="table"> tags, since thats what they
are (no markup rules for this, so it inherits from parent -- no style
change)
- Mention that pg_database, pg_shadow, and pg_group are global, and the
rest are local to the specific DB. (I believe this is correct).

> Works for me, though I suppose we could explain what the exceptions are
> like in general terms.  Perhaps something like
>
> 'Most system catalogs are copied from the template database during
> database creation, and are thereafter database-specific.  A few
> catalogs are physically shared across all databases in an installation;
> these are marked in the descriptions of the individual catalogs.'

Ok, new patch.

Rod Taylor
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.62 2002/09/24 21:26:44 tgl Exp $
d1071 6
a1076 3
      <entry>True if this is a table and it has (or recently had) any indexes.
       This is set by CREATE INDEX, but not cleared immediately by DROP INDEX.
       VACUUM clears relhasindex if it finds the table has no indexes.
d2055 5
a2059 5
       This is false for internal languages (such as SQL) and true for
       user-defined languages.  Currently,
       <application>pg_dump</application> still uses this to determine
       which languages need to be dumped, but this may be replaced by
       a different mechanism sometime.
@


2.62
log
@Update some obsolete comments and column descriptions.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.61 2002/09/22 19:42:50 tgl Exp $
d26 6
d46 2
a47 1
      <entry>pg_aggregate</entry>
d67 2
a68 1
      <entry>pg_attrdef</entry>
d73 2
a74 1
      <entry>pg_attribute</entry>
d79 2
a80 1
      <entry>pg_cast</entry>
d85 2
a86 1
      <entry>pg_class</entry>
d91 2
a92 1
      <entry>pg_constraint</entry>
d97 2
a98 1
      <entry>pg_conversion</entry>
d103 2
a104 1
      <entry>pg_database</entry>
d109 2
a110 1
      <entry>pg_depend</entry>
d115 2
a116 1
      <entry>pg_description</entry>
d121 2
a122 1
      <entry>pg_group</entry>
d127 2
a128 1
      <entry>pg_index</entry>
d133 2
a134 1
      <entry>pg_inherits</entry>
d139 2
a140 1
      <entry>pg_language</entry>
d145 2
a146 1
      <entry>pg_largeobject</entry>
d151 2
a152 1
      <entry>pg_listener</entry>
d157 2
a158 1
      <entry>pg_namespace</entry>
d163 2
a164 1
      <entry>pg_opclass</entry>
d169 2
a170 1
      <entry>pg_operator</entry>
d175 2
a176 1
      <entry>pg_proc</entry>
d181 2
a182 1
      <entry>pg_rewrite</entry>
d187 2
a188 1
      <entry>pg_shadow</entry>
d193 2
a194 1
      <entry>pg_statistic</entry>
d199 2
a200 1
      <entry>pg_trigger</entry>
d205 2
a206 1
      <entry>pg_type</entry>
@


2.61
log
@Replace pg_attribute.attisinherited with attislocal and attinhcount
columns, to allow more correct behavior in multiple-inheritance cases.
Patch by Alvaro Herrera, review by Tom Lane.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.60 2002/09/18 21:35:20 tgl Exp $
d235 1
a235 1
      <entry>Final function</entry>
d688 1
a688 1
       This is a copy of the
d690 1
a690 1
       for this column's type.
d735 2
a736 3
       type-specific input and output functions as the third
       argument. The value will generally be -1 for types that do not
       need typmod.
d756 1
a756 1
       A copy of
d758 2
a759 1
       of this column's type
d925 1
a925 1
.  Below, when we mean all of these
d1290 1
a1290 1
      <entry><type>smallint[]</type></entry>
d1297 1
a1297 1
      <entry><type>smallint[]</type></entry>
d1451 1
a1451 1
      <entry>Owner of the database, initially who created it</entry>
d1587 1
a1587 1
      <entry><type>integer</type></entry>
d1611 1
a1611 1
      <entry><type>integer</type></entry>
d1614 1
a1614 1
       column number (the objid and classid refer to the table itself).
d1697 1
a1697 3
   with the <command>COMMENT</command> command.  Client applications
   can view the descriptions by joining with this table.  Many built-in
   system objects have comments associated with them that are shown by
d1699 2
d1840 1
a1840 1
      <entry>The oid of the pg_class entry for this index</entry>
d1847 1
a1847 1
      <entry>The oid of the pg_class entry for the table this index is for</entry>
d1854 2
a1855 1
      <entry>The registered procedure if this is a functional index</entry>
d1867 3
a1869 1
       column make up the index key.
d1918 2
a1919 1
      for partial index predicate</entry>
d1954 1
a1954 3
       This is the reference to the subtable, that is, it records the
       fact that the identified table is inherited from some other
       table.
d1963 1
a1963 3
       This is the reference to the parent table, which the table
       referenced by <structfield>inhrelid</structfield> inherited
       from.
d1972 1
a1972 1
       If there is more than one parent for a subtable (multiple
d2514 5
d2590 1
a2590 1
      <entry>proistrusted</entry>
d2593 2
a2594 1
      <entry>not functional</entry>
d2647 1
a2647 1
      <entry>Data type of the return value (0 if the function does not return a value)</entry>
a2730 8
      <entry>ev_type</entry>
      <entry><type>char</type></entry>
      <entry></entry>
      <entry>Event type that the rule is for: '1' = SELECT,
      '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry>
     </row>

     <row>
d2746 8
d3063 1
a3063 1
      <entry>Trigger name (need not be unique)</entry>
d3093 1
a3093 1
      <entry>True if trigger is a RI constraint</entry>
d3260 1
a3260 1
      nothing except the type name and OID can be relied on.
d3315 1
a3315 1
      <entry>Input function</entry>
d3322 1
a3322 1
      <entry>Output function</entry>
d3426 4
a3429 9
       <structfield>typtypmod</structfield> records type-specific data
       supplied at table creation time (for example, the maximum
       length of a <type>varchar</type> column).  It is passed to
       type-specific input and output functions as the third
       argument. The value will generally be -1 for types that do not
       need typmod.  This value is copied to
       <structfield>pg_attribute.atttypmod</structfield> when
       creating a column of a domain type.
       </para></entry>
d3438 3
a3440 5
       for a domain that is an array.  (The array element type is
       typbasetype.)  Zero for non-domains and non-array domains.
       This value is copied to
       <structfield>pg_attribute.attndims</structfield> when
       creating a column of a domain type.
@


2.60
log
@Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution.  Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.59 2002/09/03 01:04:40 tgl Exp $
d825 1
a825 1
      <entry>attisinherited</entry>
d829 12
a840 2
       This column is inherited from some other relation.  An inherited
       column cannot be dropped nor renamed.
d1226 2
a1227 2
	'f' = foreign key constraint,
	'p' = primary key constraint,
d3329 1
a3329 1
	When multiple values are stored consecutively, such
@


2.59
log
@Code review and documentation updates for indisclustered patch.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.58 2002/09/02 05:52:34 momjian Exp $
d844 2
a845 3
   <structname>pg_cast</structname> stores data type conversion paths
   defined with <command>CREATE CAST</command> plus the built-in
   conversions.
d881 3
a883 3
       The OID of the function to use to perform this cast.  A 0 is
       stored if the data types are binary compatible (that is, no
       function is needed to perform the cast).
d888 2
a889 2
      <entry>castimplicit</entry>
      <entry><type>bool</type></entry>
d891 9
a899 1
      <entry>Indication whether this cast can be invoked implicitly</entry>
@


2.58
log
@Move pg_settings doc into the right section.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.57 2002/09/02 05:44:43 momjian Exp $
d1868 1
a1868 1
      <entry>unused</entry>
@


2.57
log
@Here is a documentation patch for the pg_settings virtual table. If
there are no objections, please apply.

Joe Conway
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.56 2002/08/30 19:23:18 tgl Exp $
a164 5
      <entry>pg_settings</entry>
      <entry>current session run-time parameters</entry>
     </row>

     <row>
a2860 56
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>


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

  <para>
   <structname>pg_settings</structname> virtual table allows display and update
   of current session run-time parameters. There is one entry for each of the 
   available parameters provided by <command>SHOW ALL</command>. But it is
   in a form that allows it to be joined with other relations and have a
   selection criteria applied.
  </para>

  <para>
   An <command>UPDATE</command> performed on <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>

  <table>
   <title>pg_settings Columns</title>

   <tgroup cols=4>
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry>name</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>The name of a current session run-time parameter</entry>
     </row>

     <row>
      <entry>setting</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>The value of a current session run-time parameter</entry>
@


2.56
log
@Add attisinherited column to pg_attribute; use it to guard against
column additions, deletions, and renames that would let a child table
get out of sync with its parent.  Patch by Alvaro Herrera, with some
kibitzing by Tom Lane.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.55 2002/08/28 15:02:55 tgl Exp $
d165 5
d2866 56
@


2.55
log
@Update info about relkind and pg_type entries for composite-types patch.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.54 2002/08/24 15:00:45 tgl Exp $
d821 10
@


2.54
log
@The cstring datatype can now be copied, passed around, etc.  The typlen
value '-2' is used to indicate a variable-width type whose width is
computed as strlen(datum)+1.  Everything that looks at typlen is updated
except for array support, which Joe Conway is working on; at the moment
it wouldn't work to try to create an array of cstring.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.53 2002/08/13 17:22:08 petere Exp $
d893 1
a893 1
   <structname>pg_class</structname> catalogs tables and mostly
d897 2
a898 1
   kinds of special relation.  Below, when we mean all of these
d961 1
a961 1
      <entry>Name of the on-disk file of this relation</entry>
d1034 1
a1034 1
       's' = special, 't' = secondary TOAST table
d3131 1
a3131 1
   A complex type is also created for each table in the database, to
d3133 1
d3247 5
a3251 3
       the <structfield>pg_class</structfield> entry that defines the
       corresponding table. A table could theoretically be used as a
       composite data type, but this is only partly functional.
@


2.53
log
@Remove obsolete uses of lanispl.  Only used in pg_dump now, but can be
removed altogether if pg_dump doesn't need it anymore.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.52 2002/08/05 02:30:46 tgl Exp $
d3176 7
a3182 1
      <entry>Length of the storage representation of the type, -1 if variable length</entry>
d3334 1
a3334 1
       <structfield>typstorage</structfield> tells for variable-length
@


2.52
log
@Preliminary code review for anonymous-composite-types patch: fix breakage
of functions returning domain types, update documentation for typtype,
move get_typtype to lsyscache.c (actually, resurrect the old version),
add defense against creating pseudo-typed table columns, fix some
bogus list-parsing in grammar.  Issues remain with respect to alias
handling and type checking; Joe is on those.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v 2.51 2002/08/02 18:15:04 tgl Exp $
d1994 4
a1997 2
       dynamically loaded language handler modules.  It essentially
       means that, if it is true, the language may be dropped.
@


2.51
log
@ALTER TABLE DROP COLUMN works.  Patch by Christopher Kings-Lynne,
code review by Tom Lane.  Remaining issues: functions that take or
return tuple types are likely to break if one drops (or adds!)
a column in the table defining the type.  Need to think about what
to do here.

Along the way: some code review for recent COPY changes; mark system
columns attnotnull = true where appropriate, per discussion a month ago.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.50 2002/07/31 17:19:49 tgl Exp $
d3204 3
a3206 2
       a table's row type), or <literal>d</literal> for a derived type (i.e.,
       a domain).  See also <structfield>typrelid</structfield> 
d3239 1
a3239 1
       composite data type, but this is not fully functional.
@


2.50
log
@Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 in
attstattarget to indicate 'use the default'.  The default is now a GUC
variable default_statistics_target, and so may be changed on the fly.  Along
the way we gain the ability to have pg_dump dump the per-column statistics
target when it's not the default.  Patch by Neil Conway, with some kibitzing
from Tom Lane.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.49 2002/07/30 05:24:56 tgl Exp $
d810 11
@


2.49
log
@Rewrite xindex.sgml for CREATE OPERATOR CLASS.  catalogs.sgml finally
contains descriptions of every single system table.  Update 'complex'
tutorial example too.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.48 2002/07/24 19:11:06 petere Exp $
d675 3
a677 2
       The exact meaning of positive values is data type-dependent.
       For scalar data types, <structfield>attstattarget</structfield>
@


2.48
log
@Remove unused system table columns:

pg_language.lancompiler
pg_operator.oprprec
pg_operator.oprisleft
pg_proc.proimplicit
pg_proc.probyte_pct
pg_proc.properbyte_cpu
pg_proc.propercall_cpu
pg_proc.prooutin_ratio
pg_shadow.usetrace
pg_type.typprtlen
pg_type.typreceive
pg_type.typsend

Attempts to use the obsoleted attributes of pg_operator or pg_proc
in the CREATE commands will be greeted by a warning.  For pg_type,
there is no warning (yet) because pg_dump scripts still contain these
attributes.

Also remove new but already obsolete spellings
isVolatile, isStable, isImmutable in WITH clause.  (Use new syntax
instead.)
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.47 2002/07/24 05:51:55 ishii Exp $
d24 1
a24 1
   esoteric operations, such as adding index access methods.
d183 1
a183 3
   More detailed documentation of most catalogs follow below.  The
   catalogs that relate to index access methods are explained in the
   <citetitle>Programmer's Guide</citetitle>.
d268 288
d2208 98
@


2.47
log
@Add pg_conversion system catalog. Update description for multibyte support.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.46 2002/07/22 20:23:19 petere Exp $
a1737 7
      <entry>lancompiler</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>not currently used</entry>
     </row>

     <row>
a1972 8
      <entry>oprprec</entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>precedence (currently unused, as precedences are hard-wired
      in the grammar)</entry>
     </row>

     <row>
a1982 8
      <entry>oprisleft</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>left-associativity (currently unused, as this is hard-wired
      in the grammar)</entry>
     </row>

     <row>
a2165 7
      <entry>proimplicit</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function may be invoked as an implicit type coercion</entry>
     </row>

     <row>
a2225 28
      <entry>probyte_pct</entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>dead code</entry>
     </row>

     <row>
      <entry>properbyte_cpu</entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>dead code</entry>
     </row>

     <row>
      <entry>propercall_cpu</entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>dead code</entry>
     </row>

     <row>
      <entry>prooutin_ratio</entry>
      <entry><type>int4</type></entry>
      <entry></entry>
      <entry>dead code</entry>
     </row>

     <row>
a2416 7
      <entry>usetrace</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>not used</entry>
     </row>

     <row>
a2781 7
      <entry>typprtlen</entry>
      <entry><type>int2</type></entry>
      <entry></entry>
      <entry>unused</entry>
     </row>

     <row>
a2880 14
     </row>

     <row>
      <entry>typreceive</entry>
      <entry><type>regproc</type></entry>
      <entry>pg_proc.oid</entry>
      <entry>unused</entry>
     </row>

     <row>
      <entry>typsend</entry>
      <entry><type>regproc</type></entry>
      <entry>pg_proc.oid</entry>
      <entry>unused</entry>
@


2.46
log
@Add unique index on pg_cast.oid, and document pg_cast table.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.45 2002/07/12 18:43:12 tgl Exp $
d85 5
d1000 79
@


2.45
log
@Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
constraints all have real live entries in pg_constraint.  pg_depend
exists, and RESTRICT/CASCADE options work on most kinds of DROP;
however, pg_depend is not yet very well populated with dependencies.
(Most of the ones that are present at this point just replace formerly
hardwired associations, such as the implicit drop of a relation's pg_type
entry when the relation is dropped.)  Need to add more logic to create
dependency entries, improve pg_dump to dump constraints in place of
indexes and triggers, and add some regression tests.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.44 2002/06/20 15:44:06 momjian Exp $
d70 5
d526 59
@


2.44
log
@This patch updates the CREATE LANGUAGE & pg_language docs for the 7.3
table structure.

 Dave Page
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.43 2002/04/21 00:26:42 tgl Exp $
d75 5
d85 5
a144 5
      <entry>pg_relcheck</entry>
      <entry>check constraints</entry>
     </row>

     <row>
d688 1
a688 1
       <structname>pg_relcheck</structname> catalog
d772 161
d1072 145
a2178 66


 <sect1 id="catalog-pg-relcheck">
  <title>pg_relcheck</title>

  <para>
   This system catalog stores CHECK constraints on tables.  (Column
   constraints are not treated specially.  Every column constraint is
   equivalent to some table constraint.)  See under <command>CREATE
   TABLE</command> for more information.
  </para>

  <table>
   <title>pg_relcheck Columns</title>

   <tgroup cols=4>
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>References</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry>rcrelid</entry>
      <entry><type>oid</type></entry>
      <entry>pg_class.oid</entry>
      <entry>The table this check constraint is on</entry>
     </row>

     <row>
      <entry>rcname</entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Constraint name</entry>
     </row>

     <row>
      <entry>rcbin</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>An internal representation of the constraint expression</entry>
     </row>

     <row>
      <entry>rcsrc</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry>A human-readable representation of the constraint expression</entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <note>
   <para>
    <structname>pg_class</structname>.<structfield>relchecks</structfield>
    needs to match up with the entries in this table.
   </para>
  </note>

 </sect1>

@


2.43
log
@Restructure AclItem representation so that we can have more than eight
different privilege bits (might as well make use of the space we were
wasting on padding).  EXECUTE and USAGE bits for procedures, languages
now are separate privileges instead of being overlaid on SELECT.  Add
privileges for namespaces and databases.  The GRANT and REVOKE commands
work for these object types, but we don't actually enforce the privileges
yet...
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.42 2002/04/16 23:08:09 tgl Exp $
d1263 12
@


2.42
log
@Operators live in namespaces.  CREATE/DROP/COMMENT ON OPERATOR take
qualified operator names directly, for example CREATE OPERATOR myschema.+
( ... ).  To qualify an operator name in an expression you need to write
OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch).
I also took advantage of having to reformat pg_operator to fix something
that'd been bugging me for a while: mergejoinable operators should have
explicit links to the associated cross-data-type comparison operators,
rather than hardwiring an assumption that they are named < and >.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.41 2002/04/11 19:59:54 tgl Exp $
d828 1
a828 1
       DATABASE</command> to create the new database as a clone of
d892 7
@


2.41
log
@Restructure representation of aggregate functions so that they have pg_proc
entries, per pghackers discussion.  This fixes aggregates to live in
namespaces, and also simplifies/speeds up lookup in parse_func.c.
Also, add a 'proimplicit' flag to pg_proc that controls whether a type
coercion function may be invoked implicitly, or only explicitly.  The
current settings of these flags are more permissive than I would like,
but we will need to debate and refine the behavior; for now, I avoided
breaking regression tests as much as I could.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.40 2002/04/05 00:31:22 tgl Exp $
d1486 9
d1505 2
a1506 1
      <entry>unused</entry>
d1523 2
a1524 1
      <entry>unused</entry>
d1575 1
a1575 1
       the type of the left-hand operand
d1585 21
a1605 1
       the type of the right-hand operand
d1612 1
a1612 1
      <entry></entry>
d1619 1
a1619 1
      <entry></entry>
d1626 1
a1626 1
      <entry></entry>
d2532 1
a2532 1
      <entry></entry>
d2539 1
a2539 1
      <entry></entry>
d2546 1
a2546 1
      <entry></entry>
d2553 1
a2553 1
      <entry></entry>
@


2.40
log
@Divide functions into three volatility classes (immutable, stable, and
volatile), rather than the old cachable/noncachable distinction.  This
allows indexscan optimizations in many places where we formerly didn't.
Also, add a pronamespace column to pg_proc (it doesn't do anything yet,
however).
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.39 2002/03/29 19:05:57 tgl Exp $
d186 5
a190 1
   <function>max</function>.
d207 4
a210 10
      <entry>aggname</entry>
      <entry><type>name</type></entry>
      <entry></entry>
      <entry>Name of the aggregate function</entry>
     </row>
     <row>
      <entry>aggowner</entry>
      <entry><type>int4</type></entry>
      <entry>pg_shadow.usesysid</entry>
      <entry>Owner (creator) of the aggregate function</entry>
d214 1
a214 1
      <entry><type>regproc</type> (function)</entry>
d220 1
a220 1
      <entry><type>regproc</type> (function)</entry>
a224 6
      <entry>aggbasetype</entry>
      <entry><type>oid</type></entry>
      <entry>pg_type.oid</entry>
      <entry>The input data type for this aggregate function</entry>
     </row>
     <row>
a230 6
      <entry>aggfinaltype</entry>
      <entry><type>oid</type></entry>
      <entry>pg_type.oid</entry>
      <entry>The type of the result</entry>
     </row>
     <row>
a251 6
  <para>
   An aggregate function is identified through name
   <emphasis>and</emphasis> argument type.  Hence aggname and aggbasetype
   are the composite primary key.
  </para>

d1615 6
d1666 1
a1666 1
      <entry>proisinh</entry>
d1669 1
a1669 1
      <entry>unused</entry>
d1680 7
d1699 8
a1729 8
     </row>

     <row>
      <entry>proretset</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function returns a set (ie, multiple values of the specified
      data type)</entry>
@


2.39
log
@pg_type has a typnamespace column; system now supports creating types
in different namespaces.  Also, cleanup work on relation namespace
support: drop, alter, rename commands work for tables in non-default
namespaces.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.38 2002/03/26 19:15:10 tgl Exp $
d1657 9
a1693 7
      <entry>proiscachable</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>Function returns same result for same input values</entry>
     </row>

     <row>
d1702 19
@


2.38
log
@pg_class has a relnamespace column.  You can create and access tables
in schemas other than the system namespace; however, there's no search
path yet, and not all operations work yet on tables outside the system
namespace.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.37 2002/03/22 21:34:43 tgl Exp $
d2364 9
@


2.37
log
@Create the pg_namespace system catalog.  Doesn't do much yet, but it's
there and CREATE SCHEMA will make entries in it...
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.36 2002/03/22 19:20:03 petere Exp $
d569 9
@


2.36
log
@Spell checking and markup additions
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.35 2002/03/20 19:43:24 tgl Exp $
d115 5
d1408 50
@


2.35
log
@Code review for DOMAIN patch.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.34 2002/03/19 02:18:10 momjian Exp $
d225 1
a225 1
      <entry>The input datatype for this aggregate function</entry>
d389 2
a390 2
       The exact meaning of positive values is datatype-dependent.
       For scalar datatypes, <structfield>attstattarget</structfield>
d536 1
a536 1
   <structname>pg_class</structname> catalogues tables and mostly
d587 1
a587 1
      <entry>If this is an index, the access method used (btree, hash, etc.)</entry>
d627 1
a627 1
       Oid of the TOAST table associated with this table, 0 if none.
d912 1
a912 1
   can view the descriptions by joining with this table.  Many builtin
d1651 1
a1651 1
      datatype)</entry>
d2131 1
a2131 1
      For datatype independence, all column data values are converted
d2274 1
a2274 1
   This catalog stores information about datatypes.  Scalar types
d2372 1
a2372 1
      element datatype, not the array datatype.</entry>
d2405 1
a2405 1
       <structfield>typelem</structfield> datatype with no other data.
@


2.34
log
@Add DOMAIN support.  Includes manual pages and regression tests, from
Rod Taylor.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.33 2002/03/07 16:35:32 momjian Exp $
d2277 2
a2278 1
   represent the row structure of the table.
d2349 4
a2352 5
       a base type and <literal>c</literal> for a complex type (i.e.,
       a table's row type).  If <structfield>typtype</structfield> is
       <literal>c</literal>, <structfield>typrelid</structfield> is
       the OID of the type's entry in
       <structname>pg_class</structname>.
d2385 1
d2515 10
d2527 1
a2527 1
      <entry></entry>
d2529 3
a2531 2
       <structfield>typbasetype</structfield> is the type that this one is based
       on.  Normally references the domains parent type, and is 0 otherwise.
a2534 10
	 <row>
	  <entry>typnotnull</entry>
	  <entry><type>boolean</type></entry>
	  <entry></entry>
	  <entry><para>
	   <structfield>typnotnull</structfield> represents a NOT NULL
	   constraint on a type.  Used for domains only.
	  </para></entry>
	 </row>

d2536 2
a2537 2
      <entry>typmod</entry>
      <entry><type>integer</type></entry>
d2540 1
a2540 1
       <structfield>typmod</structfield> records type-specific data
d2545 17
a2561 3
       need typmod.  This data is copied to
       <structfield>pg_attribute.atttypmod</structfield> on creation
       of a table using a domain as it's field type.
d2570 3
a2572 3
       <structfield>typdefaultbin</structfield> is NULL for types without a
       default value.  If it's not NULL, it contains the internal string
       representation of the default expression node.
d2581 8
a2588 3
       <structfield>typdefault</structfield> is NULL for types without a
       default value.  If it's not NULL, it contains the external string
       representation of the type's default value.
@


2.33
log
@Back out domain patch until it works properly.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.31 2002/03/01 22:45:03 petere Exp $
d2510 47
@


2.32
log
@Ok.  Updated patch attached.

- domain.patch -> source patch against pgsql in cvs
- drop_domain.sgml and create_domain.sgml -> New doc/src/sgml/ref docs

- dominfo.txt -> basic domain related queries I used for testing
[ ADDED TO /doc]

Enables domains of array elements -> CREATE DOMAIN dom int4[3][2];

Uses a typbasetype column to describe the origin of the domain.

Copies data to attnotnull rather than processing in execMain().

Some documentation differences from earlier.

If this is approved, I'll start working on pg_dump, and a \dD <domain>
option in psql, and regression tests.  I don't really feel like doing
those until the system table structure settles for pg_type.


CHECKS when added, will also be copied to to the table attributes.  FK
Constraints (if I ever figure out how) will be done similarly.  Both
will lbe handled by MergeDomainAttributes() which is called shortly
before MergeAttributes().

Rod Taylor
@
text
@a2513 47
      <entry>typbasetype</entry>
      <entry><type>oid</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typbasetype</structfield> is the type that this one is based
       off of.  Normally references the domains parent type, and is 0 otherwise.
      </para></entry>
     </row>

	 <row>
	  <entry>typnotnull</entry>
	  <entry><type>boolean</type></entry>
	  <entry></entry>
	  <entry><para>
	   <structfield>typnotnull</structfield> represents a NOT NULL
	   constraint on a type.  Normally used only for domains.
	  </para></entry>
	 </row>

     <row>
      <entry>typmod</entry>
      <entry><type>integer</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typmod</structfield> records type-specific data
       supplied at table creation time (for example, the maximum
       length of a <type>varchar</type> column).  It is passed to
       type-specific input and output functions as the third
       argument. The value will generally be -1 for types that do not
       need typmod.  This data is copied to
       <structfield>pg_attribute.atttypmod</structfield> on creation
       of a table using a domain as it's field type.
       </para></entry>
     </row>

     <row>
      <entry>typdefaultbin</entry>
      <entry><type>text</type></entry>
      <entry></entry>
      <entry><para>
       <structfield>typdefaultbin</structfield> is NULL for types without a
       default value.  If it's not NULL, it contains the internal string
       representation of the default expression node.
      </para></entry>
     </row>

     <row>
@


2.31
log
@User and database-specific session defaults for run-time configuration
variables.  New commands ALTER DATABASE ... SET and ALTER USER ... SET.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.30 2002/02/18 23:10:59 petere Exp $
d2510 47
@


2.30
log
@Privileges on functions and procedural languages
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.29 2001/11/21 05:53:40 thomas Exp $
d892 7
d1989 7
@


2.29
log
@Deprecate 'current' for date/time input.
Fix up references to "PostgreSQL" rather than "Postgres". Was roughly
 evenly split between the two before. ref/ files not yet done.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.28 2001/11/08 23:44:01 petere Exp $
d1264 7
d1708 7
@


2.28
log
@Use <sect1> rather than <section> to simplify formatting.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.27 2001/11/03 21:42:47 tgl Exp $
d2303 2
a2304 1
       the type is not 1, 2, or 4 bytes long, Postgres does not have
d2419 2
a2420 1
       Postgres.  When multiple values are stored consecutively, such
a2497 1

d2499 1
d2501 17
a2517 1
</chapter>
@


2.27
log
@Clean up wrong, misleading, or obsolete documentation about array types,
particularly in the CREATE TYPE reference page.  Fix some other errors
in the CREATE TYPE page, too.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.26 2001/10/15 22:47:47 tgl Exp $
d9 1
a9 1
 <section id="catalogs-overview">
d168 1
a168 1
 </section>
d171 1
a171 1
 <section id="catalog-pg-aggregate">
d267 1
a267 1
 </section>
d270 1
a270 1
 <section id="catalog-pg-attrdef">
d326 1
a326 1
 </section>
d329 1
a329 1
 <section id="catalog-pg-attribute">
d529 1
a529 1
 </section>
d532 1
a532 1
 <section id="catalog-pg-class">
d771 1
a771 1
 </section>
d774 1
a774 1
 <section id="catalog-pg-database">
d895 1
a895 1
 </section>
d898 1
a898 1
 <section id="catalog-pg-description">
d958 1
a958 1
 </section>
d961 1
a961 1
 <section id="catalog-pg-group">
d1017 1
a1017 1
 </section>
d1020 1
a1020 1
 <section id="catalog-pg-index">
d1128 1
a1128 1
 </section>
d1131 1
a1131 1
 <section id="catalog-pg-inherits">
d1188 1
a1188 1
 </section>
d1191 1
a1191 1
 <section id="catalog-pg-language">
d1268 1
a1268 1
 </section>
d1271 1
a1271 1
 <section id="catalog-pg-largeobject">
d1335 1
a1335 1
 </section>
d1338 1
a1338 1
 <section id="catalog-pg-listener">
d1394 1
a1394 1
 </section>
d1397 1
a1397 1
 <section id="catalog-pg-operator">
d1544 1
a1544 1
 </section>
d1547 1
a1547 1
 <section id="catalog-pg-proc">
d1718 1
a1718 1
 </section>
d1721 1
a1721 1
 <section id="catalog-pg-relcheck">
d1783 1
a1783 1
 </section>
d1786 1
a1786 1
 <section id="catalog-pg-rewrite">
d1870 1
a1870 1
 </section>
d1873 1
a1873 1
 <section id="catalog-pg-shadow">
d1973 1
a1973 1
 </section>
d1976 1
a1976 1
 <section id="catalog-pg-statistic">
d2111 1
a2111 1
 </section>
d2114 1
a2114 1
 <section id="catalog-pg-trigger">
d2239 1
a2239 1
 </section>
d2242 1
a2242 1
 <section id="catalog-pg-type">
d2497 1
a2497 1
 </section>
@


2.26
log
@Add note about pg_stats to pg_statistic entry; add sections for
pg_largeobject, pg_listener, pg_rewrite, pg_trigger; miscellaneous
small improvements.
@
text
@d3 1
a3 1
 $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.25 2001/09/13 15:55:22 petere Exp $
d423 3
a425 1
       Number of dimensions, if the column is an array; otherwise 0.
d1069 1
a1069 1
       This is an vector (array) of up to
d2341 3
a2343 1
      <entry>Character that separates two values of this type when parsing array input</entry>
d2367 11
a2377 8
       values of type <structfield>typelem</structfield>. A non-zero
       <structfield>typelem</structfield> does not guarantee this type
       to be a <quote>real</quote> array type; some ordinary
       fixed-length types can also be subscripted (e.g.,
       <type>oidvector</type>). Variable-length types can
       <emphasis>not</emphasis> be turned into pseudo-arrays like
       that. Hence, the way to determine whether a type is a
       <quote>true</quote> array type is typelem != 0 and typlen < 0.
@


2.25
log
@Replace ASCII-quotes with proper markup.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.24 2001/09/10 05:46:41 ishii Exp $
d66 1
a66 1
      <entry>table columns (attributes, fields)</entry>
d76 1
a76 1
      <entry>databases</entry>
d86 1
a86 1
      <entry>user groups</entry>
d165 1
a165 2
   <citetitle>Programmer's Guide</citetitle>.  Some catalogs don't
   have any documentation, yet.
d212 1
a212 1
      <entry></entry>
d218 1
a218 1
      <entry></entry>
d433 1
a433 1
       in memory this may be updated cache the offset of the attribute
d655 2
a656 1
      cluster.</entry>
d744 3
a746 1
      <entry>Table has rules</entry>
d777 2
a778 4
   about the available databases.  The
   <structname>pg_database</structname> table is shared between all
   databases of a cluster.  Databases are created with the
   <command>CREATE DATABASE</command>.  Consult the
d783 7
d969 8
d1057 1
a1057 1
      <entry><type>oid</type></entry>
d1104 2
a1105 1
      <entry>If true, this index is a unique index that represents the primary key of the table.</entry>
d1166 1
a1166 1
       This is the reference to the parent table, from which the table
d1177 1
a1177 1
       If there is more than one subtable/parent pair (multiple
d1269 126
d1634 2
a1635 1
      <entry>Function returns a set (probably not functional)</entry>
d1688 1
a1688 1
       else, depending the implementation language/call convention.
d1696 3
a1698 1
      <entry>?</entry>
d1704 12
d1768 1
a1768 1
      <entry>A human-readable representation of the consraint expression</entry>
d1784 87
d1878 1
a1878 1
   <structname>pg_user</structname> is a view on
d1887 8
d1998 14
d2112 128
d2243 7
d2317 2
a2318 2
       a basic type and <literal>c</literal> for a catalog type (i.e.,
       a table).  If <structfield>typtype</structfield> is
d2329 4
a2332 1
      <entry>???</entry>
d2347 1
a2347 1
       If this is a catalog type (see
@


2.24
log
@Fix typo.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.23 2001/09/06 02:07:41 tgl Exp $
d1740 1
a1740 1
   is stored in "slots", which are groups of associated columns whose
d1806 1
a1806 1
      "slot" of the <structname>pg_statistic</structname> row.
d1815 1
a1815 1
      Nth "slot".  For example, a histogram slot would show the "&lt;"
d1825 1
a1825 1
      "slot", or NULL if the slot kind does not involve numerical values.
d1834 1
a1834 1
      "slot", or NULL if the slot kind does not store any data values.
@


2.23
log
@Fix handling of pg_type.typdefault per bug report from Dave Blasby.
If there's anyone out there who's actually using datatype-defined
default values, this will be an incompatible change in behavior ...
but the old behavior was so broken that I doubt anyone was using it.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.22 2001/08/26 16:55:58 tgl Exp $
d1517 1
a1517 1
      <entry>properbyte_pct</entry>
d1524 1
a1524 1
      <entry>propercall_pct</entry>
@


2.22
log
@Transaction IDs wrap around, per my proposal of 13-Aug-01.  More
documentation to come, but the code is all here.  initdb forced.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.21 2001/08/21 16:35:58 tgl Exp $
d246 3
a248 1
       field which will be cast to the type of aggtranstype.
d2076 5
a2080 1
      <entry>???</entry>
@


2.21
log
@Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in
pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
index AM, not a row for each opclass name.  This allows pg_opclass to show
directly whether an AM supports an opclass, and furthermore makes it possible
to store additional information about an opclass that might be AM-dependent.
pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
previously expected the user to remember to provide in CREATE INDEX commands.
Lossiness is no longer an index-level property, but is associated with the
use of a particular operator in a particular index opclass.

Along the way, IndexSupportInitialize now uses the syscaches to retrieve
pg_amop and pg_amproc entries.  I find this reduces backend launch time by
about ten percent, at the cost of a couple more special cases in catcache.c's
IndexScanOK.

Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.

initdb forced.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.20 2001/08/10 18:57:32 tgl Exp $
d843 1
a843 1
       Last oid in existence after the database was created; useful
d845 23
@


2.20
log
@Make OIDs optional, per discussions in pghackers.  WITH OIDS is still the
default, but OIDS are removed from many system catalogs that don't need them.
Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
pg_description has a three-column key instead of one.

Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
has some usefulness; pg_dump dumps comments on indexes, rules, and
triggers in a valid order.

initdb forced.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.19 2001/07/15 22:48:15 tgl Exp $
a1050 7
     </row>

     <row>
      <entry>indislossy</entry>
      <entry><type>bool</type></entry>
      <entry></entry>
      <entry>???</entry>
@


2.19
log
@Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers.  Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc.  (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.)  The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method.  I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions.  Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.

Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).

Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error.  We discovered this need long
ago for btree, but missed the other guys.

Oh, one more thing: concurrent VACUUM is now the default.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.18 2001/06/12 05:55:48 tgl Exp $
d535 1
a535 1
   table.  This includes indexes (but see
d537 1
a537 1
   kinds of special relation kinds.  Below, when we mean all of these
d568 2
a569 2
       The data type that corresponds to this table (not functional,
       only set for system tables)
d634 3
a636 1
      <entry>Oid of the index on the TOAST table for this table, 0 if none</entry>
d643 4
a646 1
      <entry>True if this is a table and it has at least one index</entry>
d672 1
a672 1
       Number of columns in the relation, besides system columns.
d703 1
a703 1
      <entry>unused  (<emphasis>Not</emphasis> the number of unique keys or something.)</entry>
d710 17
a726 1
      <entry>Number foreign keys on the table</entry>
d734 1
a734 2
       unused  (No, this does not say whether the table has a primary
       key.  It's really unused.)
d749 1
a749 1
      <entry>At least one table inherits this one</entry>
d895 17
@


2.18
log
@Clean up various to-do items associated with system indexes:
pg_database now has unique indexes on oid and on datname.
pg_shadow now has unique indexes on usename and on usesysid.
pg_am now has unique index on oid.
pg_opclass now has unique index on oid.
pg_amproc now has unique index on amid+amopclaid+amprocnum.
Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
Remove index on pg_listener and associated syscache for performance reasons
(caching rows that are certain to change before you need 'em again is
rather pointless).
Change pg_attrdef's nonunique index on adrelid into a unique index on
adrelid+adnum.

Fix various incorrect settings of pg_class.relisshared, make that the
primary reference point for whether a relation is shared or not.
IsSharedSystemRelationName() is now only consulted to initialize relisshared
during initial creation of tables and indexes.  In theory we might now
support shared user relations, though it's not clear how one would get
entries for them into pg_class &etc of multiple databases.

Fix recently reported bug that pg_attribute rows created for an index all have
the same OID.  (Proof that non-unique OID doesn't matter unless it's
actually used to do lookups ;-))

There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
relations.  Convert them into plain system catalogs without hardwired
entries in pg_class and friends.

Unify global.bki and template1.bki into a single init script postgres.bki,
since the alleged distinction between them was misleading and pointless.
Not to mention that it didn't work for setting up indexes on shared
system relations.

Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
Also, hold locks until transaction commit where necessary.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.17 2001/05/14 20:30:19 momjian Exp $
d1048 2
a1049 1
      <entry>Query plan for partial index predicate (not functional)</entry>
@


2.17
log
@Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables.  Initdb
forced.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.16 2001/05/07 00:43:14 tgl Exp $
d648 2
a649 1
      <entry>XXX (This is not what it seems to be.)</entry>
@


2.16
log
@Rewrite of planner statistics-gathering code.  ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too).
pg_statistic redesigned to be more flexible about what statistics are
stored.  ANALYZE now collects a list of several of the most common values,
not just one, plus a histogram (not just the min and max values).  Random
sampling is used to make the process reasonably fast even on very large
tables.  The number of values and histogram bins collected is now
user-settable via an ALTER TABLE command.

There is more still to do; the new stats are not being used everywhere
they could be in the planner.  But the remaining changes for this project
should be localized, and the behavior is already better than before.

A not-very-related change is that sorting now makes use of btree comparison
routines if it can find one, rather than invoking '<' twice.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.15 2001/04/20 15:52:33 thomas Exp $
a94 5
      <entry>pg_inheritproc</entry>
      <entry>(not used)</entry>
     </row>

     <row>
a96 5
     </row>

     <row>
      <entry>pg_ipl</entry>
      <entry>(not used)</entry>
@


2.15
log
@Final markup for 7.1 hardcopy release. Mostly typo and table-fitting
 adjustments. Note that many tables are being abused with *really* long
 description columns. Should probably shrink those columns to be more
 concise, and move some of the info to follow-on reference notes.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.14 2001/03/24 23:03:26 petere Exp $
d19 1
a19 1
   Normally one never has to change the system catalogs by hand, there
d188 1
a188 1
   operates on a set of values (typically one column from each the row
d236 1
a236 1
      <entry>The type on which this function operates when invoked from SQL</entry>
d272 1
a272 1
   <emphasis>and</emphasis> argument type.  Hence aggname and aggname
d314 2
a315 5
      <entry></entry>
      <entry>
       The number of the column; see
       <structname>pg_attribute</structname>.<structfield>pg_attnum</structfield>
      </entry>
d390 2
a391 2
      <entry>attdispersion</entry>
      <entry><type>float4</type></entry>
d394 8
a401 10
       <structfield>attdispersion</structfield> is the dispersion
       statistic of the column (0.0 to 1.0), or zero if the statistic
       has not been calculated, or -1.0 if <command>VACUUM</command>
       found that the column contains no duplicate entries (in which
       case the dispersion should be taken as
       1.0/<symbol>numberOfRows</symbol> for the current table size).
       The -1.0 hack is useful because the number of rows may be
       updated more often than
       <structfield>attdispersion</structfield> is. We assume that the
       column will retain its no-duplicate-entry property.
d428 1
a428 1
      <entry>attnelems</entry>
d431 3
a433 1
      <entry>Number of dimensions, if the column is an array</entry>
d610 4
a613 2
       <symbol>BLCKSZ</symbol>).  This is only an approximate value
       which is calculated during vacuum.
d619 1
a619 1
      <entry><type>int4</type></entry>
d622 4
a625 2
       Number of tuples in the table.  This is only an estimate used
       by the planner, updated by <command>VACUUM</command>.
d1667 124
@


2.14
log
@minor copy editing
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.13 2000/12/22 18:57:49 petere Exp $
d1196 1
a1196 1
      <entry>not useful</entry>
@


2.13
log
@Replace incorrect uses of 'which' with 'that'.  (so-called "wicked which")
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.12 2000/12/11 18:26:37 momjian Exp $
d1844 1
a1844 1
         <para>'c' = CHAR alignment, ie no alignment needed.</para>
@


2.12
log
@Change to Negator.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.11 2000/12/10 22:37:27 momjian Exp $
d495 1
a495 1
       string which defines this set - i.e., the query to run to get
@


2.11
log
@Backout right-hand/left-hand.
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.10 2000/12/10 22:35:56 momjian Exp $
d1305 1
a1305 1
      <entry>Inverse of this operator, if any</entry>
@


2.10
log
@in catalog.sgml
line 1324:
"left-hand" should be "right-hand"

BTW: new document looks very good!
And the new configure/build process seems much better then before!

Thanks!

Laser
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.9 2000/12/07 22:37:08 petere Exp $
d1314 1
a1314 1
       the type of the right-hand operand
@


2.9
log
@typo correction
@
text
@d3 1
a3 1
 $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.8 2000/11/29 20:15:58 petere Exp $
d1314 1
a1314 1
       the type of the left-hand operand
@


2.8
log
@Rewrite system catalog documentation man page in DocBook with more recent
information.
@
text
@d3 1
a3 1
 $Header$
d1324 1
a1324 1
       the type of the left-hand operand
@


2.7
log
@Revise aggregate functions per earlier discussions in pghackers.
There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...
@
text
@d1 1912
a1912 445
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.6 2000/06/09 01:43:56 momjian Exp $
.TH "SYSTEM CATALOGS" INTRO 03/13/94 PostgreSQL PostgreSQL
.SH "Section 7 - System Catalogs"
.de LS
.PP
.if n .ta 5 +13 +13
.if t .ta 0.5i +1.3i +1.3i
.in 0
.nf
..
.de LE
.fi
.in
..
.SH "DESCRIPTION"
In this
section we list each of the attributes of the system catalogs and
define their meanings.
.SH "CLASS/TYPE SYSTEM CATALOGS"
These catalogs form the core of the extensibility system:
.LS
	\fBname\fP	\fBshared/local\fP	\fBdescription\fP
	pg_aggregate	local	aggregate functions
	pg_am	local	access methods
	pg_amop	local	operators usable with specific access methods
	pg_amproc	local	procedures used with specific access methods
	pg_attribute	local	class attributes
	pg_class	local	classes
	pg_index	local	indices
	pg_inherits	local	class inheritance hierarchy
	pg_language	local	procedure implementation languages
	pg_opclass	local	operator classes
	pg_operator	local	query language operators
	pg_proc	local	procedures (functions)
	pg_type	local	data types
.LE
.SH "ENTITIES"
These catalogs deal with identification of entities known throughout
the site:
.LS
	\fBname\fP	\fBshared/local\fP	\fBdescription\fP
	pg_database	shared	current databases
	pg_group	shared	user groups
	pg_shadow	shared	valid users
.LE
.SH "RULE SYSTEM CATALOGS"
.LS
	\fBname\fP	\fBshared/local\fP	\fBdescription\fP
	pg_listener	local	processes waiting on alerters
	pg_prs2plans	local	instance system procedures
	pg_prs2rule	local	instance system rules
	pg_prs2stub	local	instance system ``stubs''
	pg_rewrite	local	rewrite system information
.LE
.SH "LARGE OBJECT CATALOGS"
.PP
These catalogs are specific to the Inversion file system and large
objects in general:
.LS
	\fBname\fP	\fBshared/local\fP	\fBdescription\fP
	pg_lobj	local	description of a large object
	pg_naming	local	Inversion name space mapping
	pg_platter	local	jukebox platter inventory
	pg_plmap	local	jukebox platter extent map
.LE
.SH "INTERNAL CATALOGS"
.PP
These catalogs are internal classes that are not stored as normal
heaps and cannot be accessed through normal means (attempting to do so
causes an error).
.LS
	\fBname\fP	\fBshared/local\fP	\fBdescription\fP
	pg_log	shared	transaction commit/rollback log
	pg_magic	shared	magic constant
	pg_time	shared	commit/rollback times
	pg_variable	shared	special variable values
.LE
.PP
There are several other classes defined with \*(lqpg_\*(rq names.
Aside from those that end in \*(lqind\*(rq (secondary indices), these
are all obsolete or otherwise deprecated.
.SH "CLASS/TYPE SYSTEM CATALOGS"
.PP
The following catalogs relate to the class/type system.
.nf M
/*
 * aggregates
 *
 * see DEFINE AGGREGATE for an explanation of transition functions
 */
pg_aggregate
    NameData    aggname		/* aggregate name (e.g., "count") */
    oid         aggowner	/* usesysid of creator */
    regproc     aggtransfn	/* transition function */
    regproc     aggfinalfn	/* final function */
    oid         aggbasetype	/* type of data on which aggregate
				   operates */
    oid         aggtranstype	/* type of aggregate's transition
				   (state) data */
    oid         aggfinaltype	/* type of aggregate's final result */
    text        agginitval	/* external format of initial state value */
.fi
.nf M
pg_am
    NameData    amname          /* access method name */
    oid         amowner         /* usesysid of creator */
    int2        amstrategies    /* total NUMBER of strategies by which
                                   we can traverse/search this AM */
    int2        amsupport       /* total NUMBER of support functions
                                   that this AM uses */
    int2        amorderstrategy /* if this AM has a sort order, the
                                 * strategy number of the sort operator.
                                 * Zero if AM is not ordered.
                                 */
    regproc     amgettuple      /* "next valid tuple" function */
    regproc     aminsert        /* "insert this tuple" function */
    regproc     amdelete        /* "delete this tuple" function */
    regproc     amgetattr       /* - deprecated */
    regproc     amsetlock       /* - deprecated */
    regproc     amsettid        /* - deprecated */
    regproc     amfreetuple     /* - deprecated */
    regproc     ambeginscan     /* "start new scan" function */
    regproc     amrescan        /* "restart this scan" function */
    regproc     amendscan       /* "end this scan" function */
    regproc     ammarkpos       /* "mark current scan position"
                                   function */
    regproc     amrestrpos      /* "restore marked scan position"
                                   function */
    regproc     amopen          /* - deprecated */
    regproc     amclose         /* - deprecated */
    regproc     ambuild         /* "build new index" function */
    regproc     amcreate        /* - deprecated */
    regproc     amdestroy       /* - deprecated */
    regproc     amcostestimate  /* estimate cost of an indexscan */

.fi
.nf M
pg_amop
    oid         amopid		/* access method with which this 
				   operator be used */
    oid         amopclaid	/* operator class with which this
				   operator can be used */
    oid         amopopr	/* the operator */
    int2        amopstrategy	/* traversal/search strategy number
				   to which this operator applies */
.fi
.nf M
pg_amproc
    oid         amid		/* access method with which this
				   procedure is associated */
    oid         amopclaid	/* operator class with which this
				   operator can be used */
    oid         amproc		/* the procedure */
    int2        amprocnum	/* support function number to which
				   this operator applies */
.fi
.nf M
pg_class
     NameData     relname	/* class name */
     oid        relowner	/* usesysid of owner */
     oid        relam	/* access method */
     int4       relpages	/* # of 8KB pages */
     int4       reltuples	/* # of instances */
     abstime    relexpires	/* time after which instances are
				   deleted from non-archival storage */
     reltime    relpreserved	/* timespan after which instances are
				   deleted from non-archival storage */
     bool       relhasindex	/* does the class have a secondary
				   index? */
     bool       relisshared	/* is the class shared or local? */
     char       relkind		/* type of relation:
				   i=index
				   r=relation (heap)
				   s=special
				   u=uncatalogued (temporary) */
     char       relarch	/* archive mode:
			   h=heavy
			   l=light
			   n=none */
     int2       relnatts	/* current # of non-system
				   attributes */
     int2       relsmgr	/* storage manager:
			   0=magnetic disk
			   1=sony WORM jukebox
			   2=main memory */
     int2vector relkey		/* - unused */
     oidvector  relkeyop	/* - unused */
     bool       relhassubclass	/* does the class have a subclass?
				    */
     aclitem    relacl[1]	/* access control lists */
.fi
.nf M
pg_attribute
    oid         attrelid	/* class containing this attribute */
    NameData      attname	/* attribute name */
    oid         atttypid	/* attribute type */
    oid         attdefrel	/* - deprecated */
    int4        attnvals	/* - deprecated */
    oid         atttyparg	/* - deprecated */
    int2        attlen	/* attribute length, in bytes
			   -1=variable */
    int2        attnum	/* attribute number
			   >0=user attribute
			   <0=system attribute */
    int2        attbound	/* - deprecated */
    bool        attbyval	/* type passed by value? */
    bool        attcanindex	/* - deprecated */
    oid         attproc	/* - deprecated */
    int4        attnelems	/* # of array dimensions */
    int4        attcacheoff	/* cached offset into tuple */
    bool        attisset	/* is attribute set-valued? */
.fi
.nf M
pg_inherits
    oid         inhrel	/* child class */
    oid         inhparent	/* parent class */
    int4        inhseqno	/* - deprecated */
.fi
.nf M
    oid         indexrelid	/* oid of secondary index class */
    oid         indrelid	/* oid of indexed heap class */
    oid         indproc	/* function to compute index key from
				   attribute(s) in heap
				   0=not a functional index */
    int2vector  indkey	/* attribute numbers of key 
			   attribute(s) */
    oidvector   indclass	/* opclass of each key */
    bool        indisclustered	/* is the index clustered?
				   - unused */
    bool        indisarchived	/* is the index archival?
				   - unused */
    text        indpred	/* query plan for partial index 
			   predicate */
.fi
.nf M
pg_type
    NameData      typname	/* type name */
    oid         typowner	/* usesysid of owner */
    int2        typlen	/* length in internal form
			   -1=variable-length */
    int2        typprtlen	/* length in external form */
    bool        typbyval	/* type passed by value? */
    char        typtype	/* kind of type:
			   c=catalog (composite)
			   b=base */
    bool        typisdefined	/* defined or still a shell? */
    char        typdelim	/* delimiter for array external form */
    oid         typrelid	/* class (if composite) */
    oid         typelem	/* type of each array element */
    regproc     typinput	/* external-internal conversion
				   function */ 
    regproc     typoutput	/* internal-external conversion
				   function */
    regproc     typreceive	/* client-server conversion function */
    regproc     typsend	/* server-client conversion function */
    text        typdefault	/* default value */
.fi
.nf M
pg_operator
    NameData      oprname	/* operator name */
    oid         oprowner	/* usesysid of owner */
    int2        oprprec	/* - deprecated */
    char        oprkind	/* kind of operator:
			   b=binary
			   l=left unary
			   r=right unary */
    bool        oprisleft	/* is operator left/right associative? */
    bool        oprcanhash	/* is operator usable for hashjoin? */
    oid         oprleft	/* left operand type */
    oid         oprright	/* right operand type */
    oid         oprresult	/* result type */
    oid         oprcom	/* commutator operator */
    oid         oprnegate	/* negator operator */
    oid         oprlsortop	/* sort operator for left operand */
    oid         oprrsortop	/* sort operator for right operand */
    regproc     oprcode	/* function implementing this operator */
    regproc     oprrest	/* function to calculate operator
			   restriction selectivity */
    regproc     oprjoin	/* function to calculate operator 
			   join selectivity */
.fi
.nf M
pg_opclass
    NameData      opcname	/* operator class name */
.fi
.nf M
pg_proc
    NameData      proname	/* function name */
    oid         proowner	/* usesysid of owner */
    oid         prolang	/* function implementation language */
    bool        proisinh	/* - deprecated */
    bool        proistrusted	/* run in server or untrusted function
				   process? */
    bool        proiscachable	/* can the function return values be
				   cached? */
    int2        pronargs	/* # of arguments */
    bool        proretset	/* does the function return a set?
				   - unused */
    oid         prorettype	/* return type */
    oidvector   proargtypes	/* argument types */
    int4        probyte_pct	/* % of argument size (in bytes) that
				   needs to be examined in order to
				   compute the function */ 
    int4        properbyte_cpu	/* sensitivity of the function's
				   running time to the size of its
				   inputs */
    int4        propercall_cpu	/* overhead of the function's
				   invocation (regardless of input
				   size) */
    int4        prooutin_ratio	/* size of the function's output as a
				   percentage of the size of the input */
    text        prosrc	/* function definition:
			   INTERNAL function: actual C name of function
			   C function: currently, this field is unused
			   SQL function: text of query(s)
			   PL function: text in procedural language */
    bytea       probin	/* path to object file (C functions only) */
.fi
.nf M
pg_language
    NameData      lanname	/* language name */
    text        lancompiler	/* - deprecated */
.fi
.SH "ENTITIES"
.nf M
pg_database
    NameData      datname		/* database name */
    oid         datdba		/* usesysid of database administrator */
    text        datpath		/* directory of database under
				   $PGDATA */ 
.fi
.nf M
pg_group
    NameData      groname	/* group name */
    int2        grosysid	/* group's UNIX group id */
    int2        grolist[1]	/* list of usesysids of group members */
.fi
.nf M
pg_shadow
    NameData      usename		/* user's name */
    int2        usesysid	/* user's UNIX user id */
    bool        usecreatedb	/* can user create databases? */
    bool        usetrace	/* can user set trace flags? */
    bool        usesuper	/* can user be POSTGRES superuser? */
    bool        usecatupd	/* can user update catalogs? */
.fi
.SH "RULE SYSTEM CATALOGS"
.nf M
pg_listener
    NameData      relname	/* class for which asynchronous 
			   notification is desired */
    int4        listenerpid	/* process id of server corresponding
				   to a frontend program waiting for
				   asynchronous notification */
    int4        notification	/* whether an event notification for
				   this process id still pending */

.fi
.nf M
pg_prs2rule
    NameData      prs2name	/* rule name */
    char        prs2eventtype	/* rule event type:
				   R=retrieve
				   U=update (replace)
				   A=append
				   D=delete */
    oid         prs2eventrel	/* class to which event applies */
    int2        prs2eventattr	/* attribute to which event applies */
    float8      necessary	/* - deprecated */
    float8      sufficient	/* - deprecated */
    text        prs2text	/* text of original rule definition */
.fi
.nf M
pg_prs2plans
    oid         prs2ruleid	/* prs2rule instance for which this
				   plan is used */
    int2        prs2planno	/* plan number (one rule may invoke
				   multiple plans) */
    text        prs2code	/* external representation of the plan */
.fi
.nf M
pg_prs2stub
    oid         prs2relid	/* class to which this rule applies */
    bool        prs2islast	/* is this the last stub fragment? */
    int4        prs2no		/* stub fragment number */
    stub        prs2stub	/* stub fragment */
.fi
.nf M
pg_rewrite
    NameData      rulename	/* rule name */
    char        ev_type	/* event type:
			   RETRIEVE, REPLACE, APPEND, DELETE
			   codes are parser-dependent (!?) */
    oid         ev_class	/* class to which this rule applies */
    int2        ev_attr	/* attribute to which this rule applies */
    bool        is_instead	/* is this an "instead" rule? */
    text        ev_qual	/* qualification with which to modify
			   (rewrite) the plan that triggered this
			   rule */
    text        action	/* parse tree of action */
.fi
.SH "LARGE OBJECT CATALOGS"
.nf M
pg_lobj
    oid         ourid		/* 'ourid' from pg_naming that
				   identifies this object in the
				   Inversion file system namespace */
    int4        objtype		/* storage type code:
				   0=Inversion
				   1=Unix
				   2=External
				   3=Jaquith */
    bytea       object_descripto/* opaque object-handle structure */
.fi
.nf M
pg_naming
    NameData      filename	/* filename component */
    oid         ourid		/* random oid used to identify this
				   instance in other instances (can't
				   use the actual oid for obscure
				   reasons */
    oid         parentid	/* pg_naming instance of parent
				   Inversion file system directory */
.fi
.nf M
pg_platter
     NameData     plname		/* platter name */
     int4       plstart		/* the highest OCCUPIED extent */
.fi
.nf M
pg_plmap
     oid        plid		/* platter (in pg_platter) on which
				   this extent (of blocks) resides */
     oid        pldbid		/* database of the class to which this
				   extent (of blocks) belongs */
     oid        plrelid		/* class to which this extend (of
				   blocks) belongs */
     int4       plblkno		/* starting block number within the
				   class */ 
     int4       ploffset	/* offset within the platter at which
				   this extent begins */
     int4       plextentsz	/* length of this extent */
.fi
@


2.6
log
@Inheritance overhaul by  Chris Bitmead <chris@@bitmead.com>
@
text
@d3 1
a3 1
.\" $Header: /usr/local/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.5 2000/02/17 03:39:39 tgl Exp $
d94 1
a94 1
    NameData      aggname	/* aggregate name (e.g., "count") */
d96 1
a96 2
    regproc     aggtransfn1	/* first transition function */
    regproc     aggtransfn2	/* second transition function */
d100 4
a103 7
    oid         aggtranstype1	/* type returned by aggtransfn1 */
    oid         aggtranstype2	/* type returned by aggtransfn2 */
    oid         aggfinaltype	/* type returned by aggfinalfn */
    text        agginitval1	/* external format of initial
				   (starting) value of aggtransfn1 */
    text        agginitval2	/* external format of initial
				   (starting) value of aggtransfn2 */
@


2.5
log
@Finish repairing 6.5's problems with r-tree indexes: create appropriate
selectivity functions and make the r-tree operators use them.  The
estimation functions themselves are just stubs, unfortunately, but
perhaps someday someone will make them compute realistic estimates.
Change pg_am so that the optimizer can reliably tell the difference
between ordered and unordered indexes --- before it would think that
an r-tree index can be scanned in '<<' order, which is not right AFAIK.
Repair broken negator links for network_sup and related ops.
Initdb forced.  This might be my last initdb force for 7.0 ... hope so
anyway ...
@
text
@d3 1
a3 1
.\" $Header: /usr/local/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.4 2000/02/06 05:09:31 momjian Exp $
d194 2
@


2.4
log
@Solaris has always had problems with 1947 in the
regression tests so I prepared a set of expected
files to make things look OK.

There's also a file to account for minor variations
in the geopmetry output and a resultmap patch to
pull them all together.

With these changes PostgreSQL, from CVS, builds and
regression tests (runcheck) cleanly.

Keith Parks.
@
text
@d3 1
a3 1
.\" $Header: /usr/local/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.3 2000/01/22 23:50:08 tgl Exp $
d111 31
a141 32
    NameData      amname		/* access method name */
    oid         amowner	/* usesysid of creator */
    char        amkind		/* - deprecated */
				/* originally:
				   h=hashed
				   o=ordered
				   s=special */
    int2        amstrategies	/* total NUMBER of strategies by which
				   we can traverse/search this AM */
    int2        amsupport	/* total NUMBER of support functions
				   that this AM uses */
    regproc     amgettuple	/* "next valid tuple" function */
    regproc     aminsert	/* "insert this tuple" function */
    regproc     amdelete	/* "delete this tuple" function */
    regproc     amgetattr	/* - deprecated */
    regproc     amsetlock	/* - deprecated */
    regproc     amsettid	/* - deprecated */
    regproc     amfreetuple	/* - deprecated */
    regproc     ambeginscan	/* "start new scan" function */
    regproc     amrescan	/* "restart this scan" function */
    regproc     amendscan	/* "end this scan" function */
    regproc     ammarkpos	/* "mark current scan position"
				   function */
    regproc     amrestrpos	/* "restore marked scan position"
				   function */
    regproc     amopen		/* - deprecated */
    regproc     amclose	/* - deprecated */
    regproc     ambuild	/* "build new index" function */
    regproc     amcreate 	/* - deprecated */
    regproc     amdestroy	/* - deprecated */
    regproc     amcostestimate	/* estimate cost of an indexscan */
	
@


2.3
log
@Revise handling of index-type-specific indexscan cost estimation, per
pghackers discussion of 5-Jan-2000.  The amopselect and amopnpages
estimators are gone, and in their place is a per-AM amcostestimate
procedure (linked to from pg_am, not pg_amop).
@
text
@d3 1
a3 1
.\" $Header: /usr/local/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.2 2000/01/11 01:40:04 tgl Exp $
d31 1
a31 1
	pg_index	local	secondary indices
@


2.2
log
@Change oid8/int28 -> oidvector/int2vector.
@
text
@d3 1
a3 1
.\" $Header: /usr/local/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.1 1999/07/22 15:11:03 thomas Exp $
d141 2
a152 4
    regproc     amopselect	/* function to calculate the operator
				   selectivity */
    regproc     amopnpages	/* function to calculate the number of
				   pages that will be examined */
@


2.1
log
@Complete merge of all old man page information.
lisp.sgml is a placeholder for Eric Marsden's upcoming contribution.
catalogs.sgml is not yet marked up or integrated.
 It should perhaps become an appendix.
@
text
@d3 1
a3 1
.\" $Header: /opt/postgres/cvs/pgsql/src/man/catalogs.3,v 1.6 1999/05/20 02:44:53 tgl Exp $
d195 2
a196 2
     int28      relkey	/* - unused */
     oid8       relkeyop	/* - unused */
d232 1
a232 1
    int28       indkey	/* attribute numbers of key 
d234 1
a234 1
    oid8        indclass	/* opclass of each key */
d307 1
a307 1
    oid8        proargtypes	/* argument types */
@
