Hi,
The attached patch documents the oid column of those
system catalogs having an oid.
Distinguish system catalogs with an oid from those without
and make the primary key clear to the newbie.
Found catalogs with an oid by querying a 9.2 installation:
select pg_class.relkind, pg_class.relname
from pg_class, pg_attribute
where pg_attribute.attrelid = pg_class.oid
and pg_attribute.attname = 'oid'
and pg_class.relname like 'pg_%'
and (pg_class.relkind = 'r' -- table
or pg_class.relkind = 'v') -- view
order by pg_class.relkind, pg_class.relname;
Karl <[email protected]>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index f999190..babb11c 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -427,6 +427,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>amname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -683,6 +690,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -819,6 +833,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -902,6 +923,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -1257,6 +1285,14 @@
</thead>
<tbody>
+
+ <row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
<row>
<entry><structfield>rolname</structfield></entry>
<entry><type>name</type></entry>
@@ -1462,6 +1498,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -1577,6 +1620,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>relname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -1984,6 +2034,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>conname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -2250,6 +2307,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>collname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -2350,6 +2414,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>conname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -2443,6 +2514,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>datname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -2652,6 +2730,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -3005,6 +3090,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -3078,6 +3170,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>extname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -3174,6 +3273,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>fdwname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -3266,6 +3372,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>srvname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -3675,6 +3788,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>lanname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -3875,6 +3995,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -3927,6 +4054,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>nspname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -3995,6 +4129,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -4093,6 +4234,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>oprname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -4243,6 +4391,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -4427,6 +4582,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>proname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -4819,6 +4981,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>rulename</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -5488,6 +5657,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>spcname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -5556,6 +5732,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <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>
@@ -5741,6 +5924,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>cfgname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -5880,6 +6070,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>dictname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -5956,6 +6153,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>prsname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -6046,6 +6250,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>tmplname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -6113,6 +6324,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>typname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
@@ -6618,6 +6836,13 @@
<tbody>
<row>
+ <entry><structfield>oid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry></entry>
+ <entry>Row identifier</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>
@@ -7690,6 +7915,13 @@
<tbody>
<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>Row identifier</entry>
+ </row>
+
+ <row>
<entry><structfield>rolname</structfield></entry>
<entry><type>name</type></entry>
<entry></entry>
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers