pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedError in sample on doc page
3+ messages / 3 participants
[nested] [flat]
* Error in sample on doc page
@ 2021-11-15 05:52 PG Doc comments form <noreply@postgresql.org>
2021-11-15 10:27 ` Re: Error in sample on doc page Junk Mail <sean6907@nowisit.net>
2021-11-15 15:25 ` Re: Error in sample on doc page Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 2 replies; 3+ messages in thread
From: PG Doc comments form @ 2021-11-15 05:52 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: postgresql@nowisit.net
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/13/functions-event-triggers.html
Description:
https://www.postgresql.org/docs/13/functions-event-triggers.html
Two issues here:
1) The CREATE EVENT TRIGGER command in the sample code does not execute (see
output below)
2) When executed in an anonymous do block, there is no error. The CREATE
EVENT TRIGGER executed outside the do block should have given an error
saying already exists. Instead it gives the error: "ERROR: syntax error at
end of input".
ae_lake.cdc> do $docbug$
BEGIN
RAISE INFO 'Executing sample from PG docs:
https://www.postgresql.org/docs/13/functions-event-triggers.html...';;
CREATE FUNCTION test_event_trigger_table_rewrite_oid()
RETURNS event_trigger
LANGUAGE plpgsql AS
$$
BEGIN
RAISE NOTICE 'rewriting table % for reason %',
pg_event_trigger_table_rewrite_oid()::regclass,
pg_event_trigger_table_rewrite_reason();
END;
$$;
CREATE EVENT TRIGGER test_table_rewrite_oid
ON table_rewrite
EXECUTE FUNCTION test_event_trigger_table_rewrite_oid();
END;
$docbug$
[2021-11-14 22:47:49] [00000] Executing sample from PG docs:
https://www.postgresql.org/docs/13/functions-event-triggers.html...
[2021-11-14 22:47:49] completed in 109 ms
ae_lake.cdc> CREATE EVENT TRIGGER test_table_rewrite_oid
ON table_rewrite
[2021-11-14 22:48:09] [42601] ERROR: syntax error at end of input
[2021-11-14 22:48:09] Position: 79
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error in sample on doc page
2021-11-15 05:52 Error in sample on doc page PG Doc comments form <noreply@postgresql.org>
@ 2021-11-15 10:27 ` Junk Mail <sean6907@nowisit.net>
1 sibling, 0 replies; 3+ messages in thread
From: Junk Mail @ 2021-11-15 10:27 UTC (permalink / raw)
To: postgresql@nowisit.net; pgsql-docs@lists.postgresql.org
Disregard. This was an IDE issue.
On 11/14/21 10:52 PM, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/13/functions-event-triggers.html
> Description:
>
> https://www.postgresql.org/docs/13/functions-event-triggers.html
>
> Two issues here:
> 1) The CREATE EVENT TRIGGER command in the sample code does not execute (see
> output below)
> 2) When executed in an anonymous do block, there is no error. The CREATE
> EVENT TRIGGER executed outside the do block should have given an error
> saying already exists. Instead it gives the error: "ERROR: syntax error at
> end of input".
>
> ae_lake.cdc> do $docbug$
> BEGIN
> RAISE INFO 'Executing sample from PG docs:
> https://www.postgresql.org/docs/13/functions-event-triggers.html...';;
>
> CREATE FUNCTION test_event_trigger_table_rewrite_oid()
> RETURNS event_trigger
> LANGUAGE plpgsql AS
> $$
> BEGIN
> RAISE NOTICE 'rewriting table % for reason %',
>
> pg_event_trigger_table_rewrite_oid()::regclass,
> pg_event_trigger_table_rewrite_reason();
> END;
> $$;
>
> CREATE EVENT TRIGGER test_table_rewrite_oid
> ON table_rewrite
> EXECUTE FUNCTION test_event_trigger_table_rewrite_oid();
>
> END;
> $docbug$
> [2021-11-14 22:47:49] [00000] Executing sample from PG docs:
> https://www.postgresql.org/docs/13/functions-event-triggers.html...
> [2021-11-14 22:47:49] completed in 109 ms
> ae_lake.cdc> CREATE EVENT TRIGGER test_table_rewrite_oid
> ON table_rewrite
> [2021-11-14 22:48:09] [42601] ERROR: syntax error at end of input
> [2021-11-14 22:48:09] Position: 79
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error in sample on doc page
2021-11-15 05:52 Error in sample on doc page PG Doc comments form <noreply@postgresql.org>
@ 2021-11-15 15:25 ` Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 0 replies; 3+ messages in thread
From: Laurenz Albe @ 2021-11-15 15:25 UTC (permalink / raw)
To: postgresql@nowisit.net; pgsql-docs@lists.postgresql.org
On Mon, 2021-11-15 at 05:52 +0000, PG Doc comments form wrote:
> Two issues here:
> 1) The CREATE EVENT TRIGGER command in the sample code does not execute (see
> output below)
It works just fine for me.
> 2) When executed in an anonymous do block, there is no error. The CREATE
> EVENT TRIGGER executed outside the do block should have given an error
> saying already exists. Instead it gives the error: "ERROR: syntax error at
> end of input".
>
> ae_lake.cdc> do $docbug$
> BEGIN
> RAISE INFO 'Executing sample from PG docs:
> https://www.postgresql.org/docs/13/functions-event-triggers.html...';;
>
> CREATE FUNCTION test_event_trigger_table_rewrite_oid()
> RETURNS event_trigger
> LANGUAGE plpgsql AS
> $$
> BEGIN
> RAISE NOTICE 'rewriting table % for reason %',
>
> pg_event_trigger_table_rewrite_oid()::regclass,
> pg_event_trigger_table_rewrite_reason();
> END;
> $$;
>
> CREATE EVENT TRIGGER test_table_rewrite_oid
> ON table_rewrite
> EXECUTE FUNCTION test_event_trigger_table_rewrite_oid();
>
> END;
> $docbug$
> [2021-11-14 22:47:49] [00000] Executing sample from PG docs:
> https://www.postgresql.org/docs/13/functions-event-triggers.html...
> [2021-11-14 22:47:49] completed in 109 ms
> ae_lake.cdc> CREATE EVENT TRIGGER test_table_rewrite_oid
> ON table_rewrite
> [2021-11-14 22:48:09] [42601] ERROR: syntax error at end of input
> [2021-11-14 22:48:09] Position: 79
I don't get that error.
Perhaps you inadvertently were on a continuation line in psql.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-11-15 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 05:52 Error in sample on doc page PG Doc comments form <noreply@postgresql.org>
2021-11-15 10:27 ` Junk Mail <sean6907@nowisit.net>
2021-11-15 15:25 ` 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