From: Christoph Berg <myon@debian.org>
To: Daniel Gustafsson <daniel@yesql.se>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: plpgsql-trigger.html: Format TG_ variables as table (patch)
Date: Wed, 31 Aug 2022 14:33:24 +0200
Message-ID: <Yw9VFHD1APjGRCec@msg.df7cb.de> (raw)
In-Reply-To: <Yw9Rkn0UXvsIhACV@msg.df7cb.de>
References: <Yw4Noe3A2s87A0qq@msg.df7cb.de>
<357fec80-cb54-1455-0632-b23d844e5a68@enterprisedb.com>
<Yw8xAZhbvlzJR3Jf@msg.df7cb.de>
<Yw9MJ8/CPJ2bzi0Q@msg.df7cb.de>
<AF7104E5-8B27-4C84-8771-63972396E957@yesql.se>
<Yw9Rkn0UXvsIhACV@msg.df7cb.de>
Re: To Daniel Gustafsson
> "string containing" is again pretty boilerplatish, how about just
> "contains"?
Actually, just omitting the whole prefix works best.
TG_WHEN (text)
BEFORE, AFTER, or INSTEAD OF, depending on the trigger's definition.
I also shortened some "name of table" to just "table". Since the data
type is "name", it's clear what "table" means.
Christoph
Attachments:
[text/x-diff] 0001-plpgsql-trigger.html-Use-more-concise-wording-for-TG.patch (6.4K, ../Yw9VFHD1APjGRCec@msg.df7cb.de/2-0001-plpgsql-trigger.html-Use-more-concise-wording-for-TG.patch)
download | inline diff:
From a281bbb3ba80e14645f83d464ca6df892a85c1bb Mon Sep 17 00:00:00 2001
From: Christoph Berg <myon@debian.org>
Date: Wed, 31 Aug 2022 11:52:50 +0200
Subject: [PATCH] plpgsql-trigger.html: Use more concise wording for TG_
variables
To improve readability of the TG_ variables definition list, this moves
the datatypes up to the defined term to avoid having each entry start
with "Data type", and removes some more redundant clutter ("Variable
holding...") from the descriptions that didn't carry any information.
---
doc/src/sgml/plpgsql.sgml | 52 +++++++++++++++++++--------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgmlindex cf387dfc3f..b5cfe3c63d 100644--- a/doc/src/sgml/plpgsql.sgml+++ b/doc/src/sgml/plpgsql.sgml@@ -4032,10 +4032,10 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl
<variablelist>
<varlistentry>
- <term><varname>NEW</varname></term>+ <term><varname>NEW</varname> (record)</term>
<listitem>
<para>
- Data type <type>RECORD</type>; variable holding the new+ new
database row for <command>INSERT</command>/<command>UPDATE</command> operations in row-level
triggers. This variable is null in statement-level triggers
and for <command>DELETE</command> operations.
@@ -4044,10 +4044,10 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl
</varlistentry>
<varlistentry>
- <term><varname>OLD</varname></term>+ <term><varname>OLD</varname> (record)</term>
<listitem>
<para>
- Data type <type>RECORD</type>; variable holding the old+ old
database row for <command>UPDATE</command>/<command>DELETE</command> operations in row-level
triggers. This variable is null in statement-level triggers
and for <command>INSERT</command> operations.
@@ -4056,20 +4056,20 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl
</varlistentry>
<varlistentry>
- <term><varname>TG_NAME</varname></term>+ <term><varname>TG_NAME</varname> (name)</term>
<listitem>
<para>
- Data type <type>name</type>; variable that contains the name of the trigger actually+ name of the trigger actually
fired.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_WHEN</varname></term>+ <term><varname>TG_WHEN</varname> (text)</term>
<listitem>
<para>
- Data type <type>text</type>; a string of+ contains
<literal>BEFORE</literal>, <literal>AFTER</literal>, or
<literal>INSTEAD OF</literal>, depending on the trigger's definition.
</para>
@@ -4077,43 +4077,43 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl
</varlistentry>
<varlistentry>
- <term><varname>TG_LEVEL</varname></term>+ <term><varname>TG_LEVEL</varname> (text)</term>
<listitem>
<para>
- Data type <type>text</type>; a string of either- <literal>ROW</literal> or <literal>STATEMENT</literal>+ contains+ <literal>ROW</literal> or <literal>STATEMENT</literal>,
depending on the trigger's definition.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_OP</varname></term>+ <term><varname>TG_OP</varname> (text)</term>
<listitem>
<para>
- Data type <type>text</type>; a string of+ contains
<literal>INSERT</literal>, <literal>UPDATE</literal>,
- <literal>DELETE</literal>, or <literal>TRUNCATE</literal>+ <literal>DELETE</literal>, or <literal>TRUNCATE</literal>,
telling for which operation the trigger was fired.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_RELID</varname></term>+ <term><varname>TG_RELID</varname> (oid, references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)</term>
<listitem>
<para>
- Data type <type>oid</type>; the object ID of the table that caused the+ object ID of the table that caused the
trigger invocation.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_RELNAME</varname></term>+ <term><varname>TG_RELNAME</varname> (name)</term>
<listitem>
<para>
- Data type <type>name</type>; the name of the table that caused the trigger+ name of the table that caused the trigger
invocation. This is now deprecated, and could disappear in a future
release. Use <literal>TG_TABLE_NAME</literal> instead.
</para>
@@ -4121,40 +4121,40 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl
</varlistentry>
<varlistentry>
- <term><varname>TG_TABLE_NAME</varname></term>+ <term><varname>TG_TABLE_NAME</varname> (name)</term>
<listitem>
<para>
- Data type <type>name</type>; the name of the table that+ name of the table that
caused the trigger invocation.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_TABLE_SCHEMA</varname></term>+ <term><varname>TG_TABLE_SCHEMA</varname> (name)</term>
<listitem>
<para>
- Data type <type>name</type>; the name of the schema of the+ name of the schema of the
table that caused the trigger invocation.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_NARGS</varname></term>+ <term><varname>TG_NARGS</varname> (integer)</term>
<listitem>
<para>
- Data type <type>integer</type>; the number of arguments given to the trigger+ number of arguments given to the trigger
function in the <command>CREATE TRIGGER</command> statement.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>TG_ARGV[]</varname></term>+ <term><varname>TG_ARGV</varname> (text[])</term>
<listitem>
<para>
- Data type array of <type>text</type>; the arguments from+ arguments from
the <command>CREATE TRIGGER</command> statement.
The index counts from 0. Invalid
indexes (less than 0 or greater than or equal to <varname>tg_nargs</varname>)
--
2.35.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: myon@debian.org, daniel@yesql.se, peter.eisentraut@enterprisedb.com, pgsql-hackers@lists.postgresql.org
Subject: Re: plpgsql-trigger.html: Format TG_ variables as table (patch)
In-Reply-To: <Yw9VFHD1APjGRCec@msg.df7cb.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox