pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fix broken event trigger example
3+ messages / 2 participants
[nested] [flat]

* Fix broken event trigger example
@ 2022-12-23 12:10 Laurenz Albe <laurenz.albe@cybertec.at>
  2022-12-23 12:23 ` Re: Fix broken event trigger example Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2022-12-23 12:10 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

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

Attachments:

  [text/x-patch] 0001-Fix-event-trigger-example.patch (1.2K, ../../81e36ac17dc80489e74dc5b6914afa6ccdb1a99d.camel@cybertec.at/2-0001-Fix-event-trigger-example.patch)
  download | inline diff:
From ae0aa8d01df0626a0417c6c339f59ee50de5c2b3 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Fix broken event trigger example
  2022-12-23 12:10 Fix broken event trigger example Laurenz Albe <laurenz.albe@cybertec.at>
@ 2022-12-23 12:23 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  2022-12-23 13:01   ` Re: Fix broken event trigger example Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Alvaro Herrera @ 2022-12-23 12:23 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org

On 2022-Dec-23, Laurenz Albe wrote:

> 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.

Right, thanks.  Applied to all the relevant branches.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"On the other flipper, one wrong move and we're Fatal Exceptions"
(T.U.X.: Term Unit X  - http://www.thelinuxreview.com/TUX/)





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Fix broken event trigger example
  2022-12-23 12:10 Fix broken event trigger example Laurenz Albe <laurenz.albe@cybertec.at>
  2022-12-23 12:23 ` Re: Fix broken event trigger example Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2022-12-23 13:01   ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: Laurenz Albe @ 2022-12-23 13:01 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-docs@lists.postgresql.org

On Fri, 2022-12-23 at 13:23 +0100, Alvaro Herrera wrote:
> > 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.
> 
> Right, thanks.  Applied to all the relevant branches.

Thanks for the quick work!

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-12-23 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 12:10 Fix broken event trigger example Laurenz Albe <laurenz.albe@cybertec.at>
2022-12-23 12:23 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-12-23 13:01   ` Laurenz Albe <laurenz.albe@cybertec.at>

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