The example in 
https://www.postgresql.org/docs/current/event-trigger-example.html
stopped compiling since commit 2f9661311b.

Here is a patch to fix that.

Yours,
Laurenz Albe
From ae0aa8d01df0626a0417c6c339f59ee50de5c2b3 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.a...@cybertec.at>
Date: Fri, 23 Dec 2022 13:07:25 +0100
Subject: [PATCH] Fix event trigger example

Commit 2f9661311b changed command tags from strings to numbers,
but forgot to adjust the code in the event trigger example,
which consequently failed to compile.

While fixing that, improve the indentation to adhere to pgindent
style.

Backpatch to v13, where the change was introduced.

Author: Laurenz Albe
---
 doc/src/sgml/event-trigger.sgml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/event-trigger.sgml b/doc/src/sgml/event-trigger.sgml
index f1235a2c9f..3b6a5361b3 100644
--- a/doc/src/sgml/event-trigger.sgml
+++ b/doc/src/sgml/event-trigger.sgml
@@ -1194,8 +1194,9 @@ noddl(PG_FUNCTION_ARGS)
     trigdata = (EventTriggerData *) fcinfo->context;
 
     ereport(ERROR,
-        (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
-                 errmsg("command \"%s\" denied", trigdata->tag)));
+            (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+             errmsg("command \"%s\" denied",
+                    GetCommandTagName(trigdata->tag))));
 
     PG_RETURN_NULL();
 }
-- 
2.38.1

Reply via email to