pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chikolette-postgresql@yahoo.com <chikolette-postgresql@yahoo.com>
To: Bruce Momjian <bruce@momjian.us>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: Miles Elam <miles.elam@productops.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Event Triggers and Dropping Objects
Date: Mon, 16 Dec 2019 10:52:50 +0000 (UTC)
Message-ID: <325324141.24813367.1576493570884@mail.yahoo.com> (raw)
In-Reply-To: <CAKoxK+5pFFAbALp1=OReaD2m9wMg0g=HbMN9=JHt5gcrY44KkQ@mail.gmail.com>
References: <CAALojA_twdT4mRKHgWn9xE6XsbnqF9RVWXjLtGZD0xr_EO72+g@mail.gmail.com>
	<CAKoxK+7Kk7n_0f6xS4ygGBDadc6=-8U8RK_uz7Lv+x2NVMvKTA@mail.gmail.com>
	<20191007201252.GB4731@momjian.us>
	<CAKoxK+5pFFAbALp1=OReaD2m9wMg0g=HbMN9=JHt5gcrY44KkQ@mail.gmail.com>

 Le lundi 16 décembre 2019 à 11:13:10 UTC+1, Luca Ferrari <fluca1978@gmail.com> a écrit :

On Mon, Oct 7, 2019 at 10:12 PM Bruce Momjian <bruce@momjian.us> wrote:
> Do the Postgres docs need improvement here?

I don't know, but I would probably add a flag column in the firing
matrix to indicate when the related function will return a null tuple.

Luca

Hi folks,
i think the docs are confusing, in chapter 39.1 it tell us that the following event trigger ddl_command_start and ddl_command_end
are trapping the DROP but in the real they returns nothing usable.
The matrix in chapter 39.2 also tells us that DROP is trapped by these two.

I'm also wondering using event trigger sql_drop why 3 lines are returned :


zof [20410]=# CREATE OR REPLACE FUNCTION ddl_log_sql_drop()zof-#  RETURNS event_triggerzof-#  LANGUAGE plpgsqlzof-#  SECURITY DEFINERzof-# AS $function$zof$# DECLAREzof$#     obj record;zof$# BEGINzof$#     FOR obj INzof$#         SELECT *zof$#         FROM pg_catalog.pg_event_trigger_dropped_objects()zof$#     LOOPzof$#         RAISE NOTICE 'DROP objet : % % % %',zof$#                      obj.object_type,zof$#                      obj.schema_name,zof$#                      obj.object_name,zof$#                      obj.object_identity;zof$#     END LOOP;zof$# END;zof$# $function$;

CREATE EVENT TRIGGER ddl_log_sql_drop ON sql_dropNOTICE:  CREATE FUNCTION objet : function zof.zof.ddl_log_sql_drop()   EXECUTE PROCEDURE ddl_log_sql_drop();  CREATE FUNCTION
zof [20410]=# CREATE EVENT TRIGGER ddl_log_sql_drop ON sql_dropzof-#    EXECUTE PROCEDURE ddl_log_sql_drop();CREATE EVENT TRIGGER
zof [20410]=# drop table za;
NOTICE:  DROP objet : table zof za zof.zaNOTICE:  DROP objet : type zof za zof.zaNOTICE:  DROP objet : type zof _za zof.za[]DROP TABLE

ThxOlf
   




  

view thread (6+ messages)

Message-ID: <325324141.24813367.1576493570884@mail.yahoo.com>
Permalink:  ../325324141.24813367.1576493570884@mail.yahoo.com/
Also on:    postgresql.org/message-id/325324141.24813367.1576493570884@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: chikolette-postgresql@yahoo.com, bruce@momjian.us, fluca1978@gmail.com, miles.elam@productops.com
  Subject: Re: Event Triggers and Dropping Objects
  In-Reply-To: <325324141.24813367.1576493570884@mail.yahoo.com>
  References: <CAALojA_twdT4mRKHgWn9xE6XsbnqF9RVWXjLtGZD0xr_EO72+g@mail.gmail.com> <CAKoxK+7Kk7n_0f6xS4ygGBDadc6=-8U8RK_uz7Lv+x2NVMvKTA@mail.gmail.com> <20191007201252.GB4731@momjian.us> <CAKoxK+5pFFAbALp1=OReaD2m9wMg0g=HbMN9=JHt5gcrY44KkQ@mail.gmail.com> <325324141.24813367.1576493570884@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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