Re: Peter Eisentraut > I find the new version even harder to read. The catalog_table_entry stuff > doesn't really make sense here, since what you have before is already a > definition list, and afterwards you have the same, just marked up > "incorrectly".
Fair enough. For comparison, this is what yesterday's patch looked like: https://www.df7cb.de/s/2022-08-31.115813.w5UvAS.png > We could move the data type in the <term>, similar to how you did it in your > patch. The new version of the patch just moves up the data types, and removes the extra clutter from the beginnings of each description: https://www.df7cb.de/s/2022-08-31.115857.LkkKl8.png Christoph
>From 61bcef4b3a0a8a17c86114ef9747c6e793a5b48f Mon Sep 17 00:00:00 2001 From: Christoph Berg <m...@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 | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index cf387dfc3f..b862af35a7 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 + string <literal>BEFORE</literal>, <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>, depending on the trigger's definition. </para> @@ -4077,10 +4077,10 @@ 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 + string <literal>ROW</literal> or <literal>STATEMENT</literal> depending on the trigger's definition. </para> @@ -4088,10 +4088,10 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl </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 + string <literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>, or <literal>TRUNCATE</literal> telling for which operation the trigger was fired. @@ -4100,20 +4100,20 @@ ASSERT <replaceable class="parameter">condition</replaceable> <optional> , <repl </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