1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
Tom Lane
2008-11-09 21:24:33 +00:00
parent 1d577f5e49
commit e4718f2c9e
13 changed files with 162 additions and 197 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.180 2008/10/31 08:39:19 heikki Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.181 2008/11/09 21:24:32 tgl Exp $ -->
<!--
Documentation of the system catalogs, directed toward PostgreSQL developers
-->
@ -1711,37 +1711,6 @@
</entry>
</row>
<row>
<entry><structfield>reltriggers</structfield></entry>
<entry><type>int2</type></entry>
<entry></entry>
<entry>
Number of triggers on the table; see
<link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
</entry>
</row>
<row>
<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>
<entry><type>bool</type></entry>
@ -1765,11 +1734,21 @@
<entry><type>bool</type></entry>
<entry></entry>
<entry>
True if table has rules; see
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>
@ -4499,13 +4478,6 @@
</para>
</note>
<note>
<para>
<literal>pg_class.reltriggers</literal> needs to agree with the
number of triggers found in this table for each relation.
</para>
</note>
</sect1>
@ -6818,13 +6790,13 @@
<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 rules</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>.reltriggers</literal></entry>
<entry>true if table has triggers</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>