Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml27
-rw-r--r--doc/src/sgml/config.sgml19
-rw-r--r--doc/src/sgml/ref/alter_table.sgml33
3 files changed, 72 insertions, 7 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 9a9f9b55bef..31db6521c5e 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.145 2007/02/14 01:58:55 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.146 2007/03/19 23:38:28 wieck Exp $ -->
<!--
Documentation of the system catalogs, directed toward PostgreSQL developers
-->
@@ -3640,6 +3640,20 @@
</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>
@@ -4178,9 +4192,16 @@
<row>
<entry><structfield>tgenabled</structfield></entry>
- <entry><type>bool</type></entry>
+ <entry><type>char</type></entry>
<entry></entry>
- <entry>True if trigger is enabled</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>
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 17504b3d5e8..1fe39db2af7 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.115 2007/03/06 02:06:12 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.116 2007/03/19 23:38:28 wieck Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
@@ -3523,6 +3523,23 @@ SELECT * FROM parent WHERE key = 2400;
</listitem>
</varlistentry>
+ <varlistentry id="guc-session-replication-role" xreflabel="session_replication_role">
+ <term><varname>session_replication_role</varname> (<type>string</type>)</term>
+ <indexterm>
+ <primary><varname>session_replication_role</> configuration parameter</primary>
+ </indexterm>
+ <listitem>
+ <para>
+ Controls the trigger and rule firing for the current session.
+ See <xref linkend="sql-altertable"> for the different options to
+ enable or disable triggers and rules. Setting the variable requires
+ superuser privilege and can only be done before any query plans have
+ been cached. Possible values are <literal>origin</>,
+ <literal>replica</> and <literal>local</>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-vacuum-freeze-min-age" xreflabel="vacuum_freeze_min_age">
<term><varname>vacuum_freeze_min_age</varname> (<type>integer</type>)</term>
<indexterm>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 6ff289b21a4..9b34c4fb993 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.94 2007/02/01 00:28:18 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.95 2007/03/19 23:38:29 wieck Exp $
PostgreSQL documentation
-->
@@ -43,6 +43,12 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
DROP CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> [ RESTRICT | CASCADE ]
DISABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ]
ENABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ]
+ ENABLE REPLICA TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
+ ENABLE ALWAYS TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
+ DISABLE RULE <replaceable class="PARAMETER">rewrite_rule_name</replaceable>
+ ENABLE RULE <replaceable class="PARAMETER">rewrite_rule_name</replaceable>
+ ENABLE REPLICA RULE <replaceable class="PARAMETER">rewrite_rule_name</replaceable>
+ ENABLE ALWAYS RULE <replaceable class="PARAMETER">rewrite_rule_name</replaceable>
CLUSTER ON <replaceable class="PARAMETER">index_name</replaceable>
SET WITHOUT CLUSTER
SET WITHOUT OIDS
@@ -193,10 +199,10 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
</varlistentry>
<varlistentry>
- <term><literal>DISABLE</literal>/<literal>ENABLE TRIGGER</literal></term>
+ <term><literal>DISABLE</literal>/<literal>ENABLE [ REPLICA | ALWAYS ] TRIGGER</literal></term>
<listitem>
<para>
- These forms disable or enable trigger(s) belonging to the table.
+ These forms configure the firing of trigger(s) belonging to the table.
A disabled trigger is still known to the system, but is not executed
when its triggering event occurs. For a deferred trigger, the enable
status is checked when the event occurs, not when the trigger function
@@ -207,6 +213,27 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
requires superuser privileges; it should be done with caution since
of course the integrity of the constraint cannot be guaranteed if the
triggers are not executed.
+ The trigger firing mechanism is also affected by the configuration
+ variable <xref linkend="guc-session-replication-role">. Simply ENABLEd
+ triggers will fire when the replication role is <quote>origin</>
+ (the default) or <quote>local</>. Triggers configured ENABLE REPLICA
+ will only fire if the session is in <quote>replica</> mode and triggers
+ configured ENABLE ALWAYS will fire regardless of the current replication
+ mode.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>DISABLE</literal>/<literal>ENABLE [ REPLICA | ALWAYS ] RULE</literal></term>
+ <listitem>
+ <para>
+ These forms configure the firing of rewrite rules belonging to the table.
+ A disabled rule is still known to the system, but is not applied
+ during query rewriting. The semantics are as for disabled/enabled
+ triggers. This configuration is ignored for ON SELECT rules, which
+ are always applied in order to keep views working even if the current
+ session is in a non-default replication role.
</para>
</listitem>
</varlistentry>