3
3
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4
<title>Chapter�41.�System Catalogs</title>
4
<title>Chapter�42.�System Catalogs</title>
5
5
<link rel="stylesheet" href="stylesheet.css" type="text/css">
6
6
<link rev="made" href="pgsql-docs@postgresql.org">
7
<meta name="generator" content="DocBook XSL Stylesheets V1.64.1">
8
<link rel="home" href="index.html" title="PostgreSQL 8.0.0beta5 Documentation">
7
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
8
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
9
9
<link rel="up" href="internals.html" title="Part�VII.�Internals">
10
<link rel="previous" href="executor.html" title="40.6.�Executor">
11
<link rel="next" href="catalog-pg-aggregate.html" title="41.2.�pg_aggregate">
10
<link rel="prev" href="executor.html" title="41.6.�Executor">
11
<link rel="next" href="catalog-pg-aggregate.html" title="42.2.�pg_aggregate">
12
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
13
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter" lang="en" id="catalogs">
14
<div class="titlepage">
15
<div><div><h2 class="title">
16
<a name="catalogs"></a>Chapter�41.�System Catalogs</h2></div></div>
15
<div class="titlepage"><div><div><h2 class="title">
16
<a name="catalogs"></a>Chapter�42.�System Catalogs</h2></div></div></div>
20
18
<p><b>Table of Contents</b></p>
22
<dt><span class="sect1"><a href="catalogs.html#catalogs-overview">41.1. Overview</a></span></dt>
23
<dt><span class="sect1"><a href="catalog-pg-aggregate.html">41.2. pg_aggregate</a></span></dt>
24
<dt><span class="sect1"><a href="catalog-pg-am.html">41.3. pg_am</a></span></dt>
25
<dt><span class="sect1"><a href="catalog-pg-amop.html">41.4. pg_amop</a></span></dt>
26
<dt><span class="sect1"><a href="catalog-pg-amproc.html">41.5. pg_amproc</a></span></dt>
27
<dt><span class="sect1"><a href="catalog-pg-attrdef.html">41.6. pg_attrdef</a></span></dt>
28
<dt><span class="sect1"><a href="catalog-pg-attribute.html">41.7. pg_attribute</a></span></dt>
29
<dt><span class="sect1"><a href="catalog-pg-cast.html">41.8. pg_cast</a></span></dt>
30
<dt><span class="sect1"><a href="catalog-pg-class.html">41.9. pg_class</a></span></dt>
31
<dt><span class="sect1"><a href="catalog-pg-constraint.html">41.10. pg_constraint</a></span></dt>
32
<dt><span class="sect1"><a href="catalog-pg-conversion.html">41.11. pg_conversion</a></span></dt>
33
<dt><span class="sect1"><a href="catalog-pg-database.html">41.12. pg_database</a></span></dt>
34
<dt><span class="sect1"><a href="catalog-pg-depend.html">41.13. pg_depend</a></span></dt>
35
<dt><span class="sect1"><a href="catalog-pg-description.html">41.14. pg_description</a></span></dt>
36
<dt><span class="sect1"><a href="catalog-pg-group.html">41.15. pg_group</a></span></dt>
37
<dt><span class="sect1"><a href="catalog-pg-index.html">41.16. pg_index</a></span></dt>
38
<dt><span class="sect1"><a href="catalog-pg-inherits.html">41.17. pg_inherits</a></span></dt>
39
<dt><span class="sect1"><a href="catalog-pg-language.html">41.18. pg_language</a></span></dt>
40
<dt><span class="sect1"><a href="catalog-pg-largeobject.html">41.19. pg_largeobject</a></span></dt>
41
<dt><span class="sect1"><a href="catalog-pg-listener.html">41.20. pg_listener</a></span></dt>
42
<dt><span class="sect1"><a href="catalog-pg-namespace.html">41.21. pg_namespace</a></span></dt>
43
<dt><span class="sect1"><a href="catalog-pg-opclass.html">41.22. pg_opclass</a></span></dt>
44
<dt><span class="sect1"><a href="catalog-pg-operator.html">41.23. pg_operator</a></span></dt>
45
<dt><span class="sect1"><a href="catalog-pg-proc.html">41.24. pg_proc</a></span></dt>
46
<dt><span class="sect1"><a href="catalog-pg-rewrite.html">41.25. pg_rewrite</a></span></dt>
47
<dt><span class="sect1"><a href="catalog-pg-shadow.html">41.26. pg_shadow</a></span></dt>
48
<dt><span class="sect1"><a href="catalog-pg-statistic.html">41.27. pg_statistic</a></span></dt>
49
<dt><span class="sect1"><a href="catalog-pg-tablespace.html">41.28. pg_tablespace</a></span></dt>
50
<dt><span class="sect1"><a href="catalog-pg-trigger.html">41.29. pg_trigger</a></span></dt>
51
<dt><span class="sect1"><a href="catalog-pg-type.html">41.30. pg_type</a></span></dt>
52
<dt><span class="sect1"><a href="views-overview.html">41.31. System Views</a></span></dt>
53
<dt><span class="sect1"><a href="view-pg-indexes.html">41.32. pg_indexes</a></span></dt>
54
<dt><span class="sect1"><a href="view-pg-locks.html">41.33. pg_locks</a></span></dt>
55
<dt><span class="sect1"><a href="view-pg-rules.html">41.34. pg_rules</a></span></dt>
56
<dt><span class="sect1"><a href="view-pg-settings.html">41.35. pg_settings</a></span></dt>
57
<dt><span class="sect1"><a href="view-pg-stats.html">41.36. pg_stats</a></span></dt>
58
<dt><span class="sect1"><a href="view-pg-tables.html">41.37. pg_tables</a></span></dt>
59
<dt><span class="sect1"><a href="view-pg-user.html">41.38. pg_user</a></span></dt>
60
<dt><span class="sect1"><a href="view-pg-views.html">41.39. pg_views</a></span></dt>
20
<dt><span class="sect1"><a href="catalogs.html#catalogs-overview">42.1. Overview</a></span></dt>
21
<dt><span class="sect1"><a href="catalog-pg-aggregate.html">42.2. <code class="structname">pg_aggregate</code></a></span></dt>
22
<dt><span class="sect1"><a href="catalog-pg-am.html">42.3. <code class="structname">pg_am</code></a></span></dt>
23
<dt><span class="sect1"><a href="catalog-pg-amop.html">42.4. <code class="structname">pg_amop</code></a></span></dt>
24
<dt><span class="sect1"><a href="catalog-pg-amproc.html">42.5. <code class="structname">pg_amproc</code></a></span></dt>
25
<dt><span class="sect1"><a href="catalog-pg-attrdef.html">42.6. <code class="structname">pg_attrdef</code></a></span></dt>
26
<dt><span class="sect1"><a href="catalog-pg-attribute.html">42.7. <code class="structname">pg_attribute</code></a></span></dt>
27
<dt><span class="sect1"><a href="catalog-pg-authid.html">42.8. <code class="structname">pg_authid</code></a></span></dt>
28
<dt><span class="sect1"><a href="catalog-pg-auth-members.html">42.9. <code class="structname">pg_auth_members</code></a></span></dt>
29
<dt><span class="sect1"><a href="catalog-pg-autovacuum.html">42.10. <code class="structname">pg_autovacuum</code></a></span></dt>
30
<dt><span class="sect1"><a href="catalog-pg-cast.html">42.11. <code class="structname">pg_cast</code></a></span></dt>
31
<dt><span class="sect1"><a href="catalog-pg-class.html">42.12. <code class="structname">pg_class</code></a></span></dt>
32
<dt><span class="sect1"><a href="catalog-pg-constraint.html">42.13. <code class="structname">pg_constraint</code></a></span></dt>
33
<dt><span class="sect1"><a href="catalog-pg-conversion.html">42.14. <code class="structname">pg_conversion</code></a></span></dt>
34
<dt><span class="sect1"><a href="catalog-pg-database.html">42.15. <code class="structname">pg_database</code></a></span></dt>
35
<dt><span class="sect1"><a href="catalog-pg-depend.html">42.16. <code class="structname">pg_depend</code></a></span></dt>
36
<dt><span class="sect1"><a href="catalog-pg-description.html">42.17. <code class="structname">pg_description</code></a></span></dt>
37
<dt><span class="sect1"><a href="catalog-pg-index.html">42.18. <code class="structname">pg_index</code></a></span></dt>
38
<dt><span class="sect1"><a href="catalog-pg-inherits.html">42.19. <code class="structname">pg_inherits</code></a></span></dt>
39
<dt><span class="sect1"><a href="catalog-pg-language.html">42.20. <code class="structname">pg_language</code></a></span></dt>
40
<dt><span class="sect1"><a href="catalog-pg-largeobject.html">42.21. <code class="structname">pg_largeobject</code></a></span></dt>
41
<dt><span class="sect1"><a href="catalog-pg-listener.html">42.22. <code class="structname">pg_listener</code></a></span></dt>
42
<dt><span class="sect1"><a href="catalog-pg-namespace.html">42.23. <code class="structname">pg_namespace</code></a></span></dt>
43
<dt><span class="sect1"><a href="catalog-pg-opclass.html">42.24. <code class="structname">pg_opclass</code></a></span></dt>
44
<dt><span class="sect1"><a href="catalog-pg-operator.html">42.25. <code class="structname">pg_operator</code></a></span></dt>
45
<dt><span class="sect1"><a href="catalog-pg-pltemplate.html">42.26. <code class="structname">pg_pltemplate</code></a></span></dt>
46
<dt><span class="sect1"><a href="catalog-pg-proc.html">42.27. <code class="structname">pg_proc</code></a></span></dt>
47
<dt><span class="sect1"><a href="catalog-pg-rewrite.html">42.28. <code class="structname">pg_rewrite</code></a></span></dt>
48
<dt><span class="sect1"><a href="catalog-pg-shdepend.html">42.29. <code class="structname">pg_shdepend</code></a></span></dt>
49
<dt><span class="sect1"><a href="catalog-pg-statistic.html">42.30. <code class="structname">pg_statistic</code></a></span></dt>
50
<dt><span class="sect1"><a href="catalog-pg-tablespace.html">42.31. <code class="structname">pg_tablespace</code></a></span></dt>
51
<dt><span class="sect1"><a href="catalog-pg-trigger.html">42.32. <code class="structname">pg_trigger</code></a></span></dt>
52
<dt><span class="sect1"><a href="catalog-pg-type.html">42.33. <code class="structname">pg_type</code></a></span></dt>
53
<dt><span class="sect1"><a href="views-overview.html">42.34. System Views</a></span></dt>
54
<dt><span class="sect1"><a href="view-pg-group.html">42.35. <code class="structname">pg_group</code></a></span></dt>
55
<dt><span class="sect1"><a href="view-pg-indexes.html">42.36. <code class="structname">pg_indexes</code></a></span></dt>
56
<dt><span class="sect1"><a href="view-pg-locks.html">42.37. <code class="structname">pg_locks</code></a></span></dt>
57
<dt><span class="sect1"><a href="view-pg-prepared-xacts.html">42.38. <code class="structname">pg_prepared_xacts</code></a></span></dt>
58
<dt><span class="sect1"><a href="view-pg-roles.html">42.39. <code class="structname">pg_roles</code></a></span></dt>
59
<dt><span class="sect1"><a href="view-pg-rules.html">42.40. <code class="structname">pg_rules</code></a></span></dt>
60
<dt><span class="sect1"><a href="view-pg-settings.html">42.41. <code class="structname">pg_settings</code></a></span></dt>
61
<dt><span class="sect1"><a href="view-pg-shadow.html">42.42. <code class="structname">pg_shadow</code></a></span></dt>
62
<dt><span class="sect1"><a href="view-pg-stats.html">42.43. <code class="structname">pg_stats</code></a></span></dt>
63
<dt><span class="sect1"><a href="view-pg-tables.html">42.44. <code class="structname">pg_tables</code></a></span></dt>
64
<dt><span class="sect1"><a href="view-pg-user.html">42.45. <code class="structname">pg_user</code></a></span></dt>
65
<dt><span class="sect1"><a href="view-pg-views.html">42.46. <code class="structname">pg_views</code></a></span></dt>
63
68
<p> The system catalogs are the place where a relational database
67
72
tables. You can drop and recreate the tables, add columns, insert
68
73
and update values, and severely mess up your system that way.
69
74
Normally, one should not change the system catalogs by hand, there
70
are always SQL commands to do that. (For example, <tt class="command">CREATE
71
DATABASE</tt> inserts a row into the
72
<tt class="structname">pg_database</tt> catalog [mdash ] and actually
75
are always SQL commands to do that. (For example, <code class="command">CREATE
76
DATABASE</code> inserts a row into the
77
<code class="structname">pg_database</code> catalog [mdash ] and actually
73
78
creates the database on disk.) There are some exceptions for
74
79
particularly esoteric operations, such as adding index access methods.
76
81
<div class="sect1" lang="en">
77
<div class="titlepage">
78
<div><div><h2 class="title" style="clear: both">
79
<a name="catalogs-overview"></a>41.1.�Overview</h2></div></div>
82
<p> <a href="catalogs.html#catalog-table" title="Table�41.1.�System Catalogs">Table�41.1, “System Catalogs”</a> lists the system catalogs.
82
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
83
<a name="catalogs-overview"></a>42.1.�Overview</h2></div></div></div>
84
<p> <a href="catalogs.html#catalog-table" title="Table�42.1.�System Catalogs">Table�42.1, “System Catalogs”</a> lists the system catalogs.
83
85
More detailed documentation of each catalog follows below.
85
87
<p> Most system catalogs are copied from the template database during
86
88
database creation and are thereafter database-specific. A few
87
89
catalogs are physically shared across all databases in a cluster;
88
these are marked in the descriptions of the individual catalogs.
90
these are noted in the descriptions of the individual catalogs.
90
92
<div class="table">
91
<a name="catalog-table"></a><p class="title"><b>Table�41.1.�System Catalogs</b></p>
92
<table summary="System Catalogs" border="1">
93
<a name="catalog-table"></a><p class="title"><b>Table�42.1.�System Catalogs</b></p>
94
<div class="table-contents"><table summary="System Catalogs" border="1">
103
<td><a href="catalog-pg-aggregate.html" title="41.2.�pg_aggregate"><tt class="structname">pg_aggregate</tt></a></td>
105
<td><a href="catalog-pg-aggregate.html" title="42.2.�pg_aggregate"><code class="structname">pg_aggregate</code></a></td>
104
106
<td>aggregate functions</td>
107
<td><a href="catalog-pg-am.html" title="41.3.�pg_am"><tt class="structname">pg_am</tt></a></td>
109
<td><a href="catalog-pg-am.html" title="42.3.�pg_am"><code class="structname">pg_am</code></a></td>
108
110
<td>index access methods</td>
111
<td><a href="catalog-pg-amop.html" title="41.4.�pg_amop"><tt class="structname">pg_amop</tt></a></td>
113
<td><a href="catalog-pg-amop.html" title="42.4.�pg_amop"><code class="structname">pg_amop</code></a></td>
112
114
<td>access method operators</td>
115
<td><a href="catalog-pg-amproc.html" title="41.5.�pg_amproc"><tt class="structname">pg_amproc</tt></a></td>
117
<td><a href="catalog-pg-amproc.html" title="42.5.�pg_amproc"><code class="structname">pg_amproc</code></a></td>
116
118
<td>access method support procedures</td>
119
<td><a href="catalog-pg-attrdef.html" title="41.6.�pg_attrdef"><tt class="structname">pg_attrdef</tt></a></td>
121
<td><a href="catalog-pg-attrdef.html" title="42.6.�pg_attrdef"><code class="structname">pg_attrdef</code></a></td>
120
122
<td>column default values</td>
123
<td><a href="catalog-pg-attribute.html" title="41.7.�pg_attribute"><tt class="structname">pg_attribute</tt></a></td>
125
<td><a href="catalog-pg-attribute.html" title="42.7.�pg_attribute"><code class="structname">pg_attribute</code></a></td>
124
126
<td>table columns (“<span class="quote">attributes</span>”)</td>
127
<td><a href="catalog-pg-cast.html" title="41.8.�pg_cast"><tt class="structname">pg_cast</tt></a></td>
129
<td><a href="catalog-pg-authid.html" title="42.8.�pg_authid"><code class="structname">pg_authid</code></a></td>
130
<td>authorization identifiers (roles)</td>
133
<td><a href="catalog-pg-auth-members.html" title="42.9.�pg_auth_members"><code class="structname">pg_auth_members</code></a></td>
134
<td>authorization identifier membership relationships</td>
137
<td><a href="catalog-pg-autovacuum.html" title="42.10.�pg_autovacuum"><code class="structname">pg_autovacuum</code></a></td>
138
<td>per-relation autovacuum configuration parameters</td>
141
<td><a href="catalog-pg-cast.html" title="42.11.�pg_cast"><code class="structname">pg_cast</code></a></td>
128
142
<td>casts (data type conversions)</td>
131
<td><a href="catalog-pg-class.html" title="41.9.�pg_class"><tt class="structname">pg_class</tt></a></td>
132
<td>tables, indexes, sequences (“<span class="quote">relations</span>”)</td>
145
<td><a href="catalog-pg-class.html" title="42.12.�pg_class"><code class="structname">pg_class</code></a></td>
146
<td>tables, indexes, sequences, views (“<span class="quote">relations</span>”)</td>
135
<td><a href="catalog-pg-constraint.html" title="41.10.�pg_constraint"><tt class="structname">pg_constraint</tt></a></td>
149
<td><a href="catalog-pg-constraint.html" title="42.13.�pg_constraint"><code class="structname">pg_constraint</code></a></td>
136
150
<td>check constraints, unique constraints, primary key constraints, foreign key constraints</td>
139
<td><a href="catalog-pg-conversion.html" title="41.11.�pg_conversion"><tt class="structname">pg_conversion</tt></a></td>
153
<td><a href="catalog-pg-conversion.html" title="42.14.�pg_conversion"><code class="structname">pg_conversion</code></a></td>
140
154
<td>encoding conversion information</td>
143
<td><a href="catalog-pg-database.html" title="41.12.�pg_database"><tt class="structname">pg_database</tt></a></td>
157
<td><a href="catalog-pg-database.html" title="42.15.�pg_database"><code class="structname">pg_database</code></a></td>
144
158
<td>databases within this database cluster</td>
147
<td><a href="catalog-pg-depend.html" title="41.13.�pg_depend"><tt class="structname">pg_depend</tt></a></td>
161
<td><a href="catalog-pg-depend.html" title="42.16.�pg_depend"><code class="structname">pg_depend</code></a></td>
148
162
<td>dependencies between database objects</td>
151
<td><a href="catalog-pg-description.html" title="41.14.�pg_description"><tt class="structname">pg_description</tt></a></td>
165
<td><a href="catalog-pg-description.html" title="42.17.�pg_description"><code class="structname">pg_description</code></a></td>
152
166
<td>descriptions or comments on database objects</td>
155
<td><a href="catalog-pg-group.html" title="41.15.�pg_group"><tt class="structname">pg_group</tt></a></td>
156
<td>groups of database users</td>
159
<td><a href="catalog-pg-index.html" title="41.16.�pg_index"><tt class="structname">pg_index</tt></a></td>
169
<td><a href="catalog-pg-index.html" title="42.18.�pg_index"><code class="structname">pg_index</code></a></td>
160
170
<td>additional index information</td>
163
<td><a href="catalog-pg-inherits.html" title="41.17.�pg_inherits"><tt class="structname">pg_inherits</tt></a></td>
173
<td><a href="catalog-pg-inherits.html" title="42.19.�pg_inherits"><code class="structname">pg_inherits</code></a></td>
164
174
<td>table inheritance hierarchy</td>
167
<td><a href="catalog-pg-language.html" title="41.18.�pg_language"><tt class="structname">pg_language</tt></a></td>
177
<td><a href="catalog-pg-language.html" title="42.20.�pg_language"><code class="structname">pg_language</code></a></td>
168
178
<td>languages for writing functions</td>
171
<td><a href="catalog-pg-largeobject.html" title="41.19.�pg_largeobject"><tt class="structname">pg_largeobject</tt></a></td>
181
<td><a href="catalog-pg-largeobject.html" title="42.21.�pg_largeobject"><code class="structname">pg_largeobject</code></a></td>
172
182
<td>large objects</td>
175
<td><a href="catalog-pg-listener.html" title="41.20.�pg_listener"><tt class="structname">pg_listener</tt></a></td>
185
<td><a href="catalog-pg-listener.html" title="42.22.�pg_listener"><code class="structname">pg_listener</code></a></td>
176
186
<td>asynchronous notification support</td>
179
<td><a href="catalog-pg-namespace.html" title="41.21.�pg_namespace"><tt class="structname">pg_namespace</tt></a></td>
189
<td><a href="catalog-pg-namespace.html" title="42.23.�pg_namespace"><code class="structname">pg_namespace</code></a></td>
183
<td><a href="catalog-pg-opclass.html" title="41.22.�pg_opclass"><tt class="structname">pg_opclass</tt></a></td>
193
<td><a href="catalog-pg-opclass.html" title="42.24.�pg_opclass"><code class="structname">pg_opclass</code></a></td>
184
194
<td>index access method operator classes</td>
187
<td><a href="catalog-pg-operator.html" title="41.23.�pg_operator"><tt class="structname">pg_operator</tt></a></td>
197
<td><a href="catalog-pg-operator.html" title="42.25.�pg_operator"><code class="structname">pg_operator</code></a></td>
188
198
<td>operators</td>
191
<td><a href="catalog-pg-proc.html" title="41.24.�pg_proc"><tt class="structname">pg_proc</tt></a></td>
201
<td><a href="catalog-pg-pltemplate.html" title="42.26.�pg_pltemplate"><code class="structname">pg_pltemplate</code></a></td>
202
<td>template data for procedural languages</td>
205
<td><a href="catalog-pg-proc.html" title="42.27.�pg_proc"><code class="structname">pg_proc</code></a></td>
192
206
<td>functions and procedures</td>
195
<td><a href="catalog-pg-rewrite.html" title="41.25.�pg_rewrite"><tt class="structname">pg_rewrite</tt></a></td>
209
<td><a href="catalog-pg-rewrite.html" title="42.28.�pg_rewrite"><code class="structname">pg_rewrite</code></a></td>
196
210
<td>query rewrite rules</td>
199
<td><a href="catalog-pg-shadow.html" title="41.26.�pg_shadow"><tt class="structname">pg_shadow</tt></a></td>
200
<td>database users</td>
213
<td><a href="catalog-pg-shdepend.html" title="42.29.�pg_shdepend"><code class="structname">pg_shdepend</code></a></td>
214
<td>dependencies on shared objects</td>
203
<td><a href="catalog-pg-statistic.html" title="41.27.�pg_statistic"><tt class="structname">pg_statistic</tt></a></td>
217
<td><a href="catalog-pg-statistic.html" title="42.30.�pg_statistic"><code class="structname">pg_statistic</code></a></td>
204
218
<td>planner statistics</td>
207
<td><a href="catalog-pg-tablespace.html" title="41.28.�pg_tablespace"><tt class="structname">pg_tablespace</tt></a></td>
221
<td><a href="catalog-pg-tablespace.html" title="42.31.�pg_tablespace"><code class="structname">pg_tablespace</code></a></td>
208
222
<td>tablespaces within this database cluster</td>
211
<td><a href="catalog-pg-trigger.html" title="41.29.�pg_trigger"><tt class="structname">pg_trigger</tt></a></td>
225
<td><a href="catalog-pg-trigger.html" title="42.32.�pg_trigger"><code class="structname">pg_trigger</code></a></td>
212
226
<td>triggers</td>
215
<td><a href="catalog-pg-type.html" title="41.30.�pg_type"><tt class="structname">pg_type</tt></a></td>
229
<td><a href="catalog-pg-type.html" title="42.33.�pg_type"><code class="structname">pg_type</code></a></td>
216
230
<td>data types</td>
235
<br class="table-break">