Re: sql_drop Event Trigger - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: sql_drop Event Trigger
Date
Msg-id m2ppzhrhuv.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: sql_drop Event Trigger  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: sql_drop Event Trigger  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: sql_drop Event Trigger  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:

> Dimitri Fontaine escribió:
>
>> The good news is that the patch to do that has already been sent on this
>> list, and got reviewed in details by Álvaro who did offer incremental
>> changes. Version 3 of that patch is to be found in:
>>
>>   http://www.postgresql.org/message-id/m2fw19n1hr.fsf@2ndQuadrant.fr
>
> Here's a v4 of that patch.  I added support for DROP OWNED, and added
> object name and schema name available to the pg_dropped_objects
> function.

Thanks!

> Do we want some more stuff provided by pg_dropped_objects?  We now have
> classId, objectId, objectSubId, object name, schema name.  One further
> thing I think we need is the object's type, i.e. a simple untranslated
> string "table", "view", "operator" and so on.  AFAICT this requires a
> nearly-duplicate of getObjectDescription.

About what missing information to add, please review:
 http://wiki.postgresql.org/wiki/Event_Triggers#How_to_expose_Information_to_Event_Triggers_Functions

I'd like us to provide the same set of extra information from within
classic Event Triggers and in the records returned by the function.

Maybe a good idea would be to create a datatype for that, and publish a
single TG_DETAILS variable from within Event Triggers, of that type, and
have the pg_dropped_objects() function return a setof that type?

About the implementation and the getObjectDescription() remark, please
have a look at your latest revision of the other patch in the series,
 http://www.postgresql.org/message-id/20130109165829.GB4490@alvh.no-ip.org

I think it provides exactly what you need here, and you already did
cleanup my work for getting at that…

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Commitfest progress
Next
From: Greg Stark
Date:
Subject: Re: Materialized views WIP patch