Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmfoN-00017o-6T for pgsql-docs@arkaria.postgresql.org; Mon, 15 Nov 2021 17:30:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mmfoM-0003Dw-05 for pgsql-docs@arkaria.postgresql.org; Mon, 15 Nov 2021 17:30:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmZD0-0004pG-H5 for pgsql-docs@lists.postgresql.org; Mon, 15 Nov 2021 10:27:30 +0000 Received: from cross.elm.relay.mailchannels.net ([23.83.212.46]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmZCs-00014O-UZ for pgsql-docs@lists.postgresql.org; Mon, 15 Nov 2021 10:27:29 +0000 X-Sender-Id: dreamhost|x-authsender|sean6907@nowisit.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7BA98341F27; Mon, 15 Nov 2021 10:27:20 +0000 (UTC) Received: from pdx1-sub0-mail-a238.dreamhost.com (100-96-18-151.trex.outbound.svc.cluster.local [100.96.18.151]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 0F351341DEE; Mon, 15 Nov 2021 10:27:20 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|sean6907@nowisit.net Received: from pdx1-sub0-mail-a238.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.18.151 (trex/6.4.3); Mon, 15 Nov 2021 10:27:20 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|sean6907@nowisit.net X-MailChannels-Auth-Id: dreamhost X-Occur-Shoe: 13c363d76bb15f06_1636972040280_1206019196 X-MC-Loop-Signature: 1636972040280:3446337483 X-MC-Ingress-Time: 1636972040280 Received: from [192.168.1.3] (unknown [98.97.57.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sean6907@nowisit.net) by pdx1-sub0-mail-a238.dreamhost.com (Postfix) with ESMTPSA id 4Ht53W54VZz1Ps; Mon, 15 Nov 2021 02:27:19 -0800 (PST) Message-ID: <9c82e84e-6ae4-1f11-db47-41a7d7a04212@nowisit.net> Date: Mon, 15 Nov 2021 03:27:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: Error in sample on doc page Content-Language: en-US To: postgresql@nowisit.net, pgsql-docs@lists.postgresql.org References: <163695554137.11069.14314706306790865461@wrigleys.postgresql.org> From: Junk Mail In-Reply-To: <163695554137.11069.14314706306790865461@wrigleys.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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