Skip site navigation (1) Skip section navigation (2)

Re: sql_drop Event Trigger

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: sql_drop Event Trigger
Date: 2013-01-30 17:59:52
Message-ID: m28v7ad013.fsf@2ndQuadrant.fr (view raw or flat)
Thread:
Lists: pgsql-hackers
Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> writes:
> So please find attached to this email an implementation of the sql_drop
> event trigger, that refrains on exposing any new information to the
> users.

Already a v1 of that patch, per comments from Álvaro I reuse the
ObjectAddresses facility rather than building my own List of object
addresses.

Note that with that in place it's now easy to also add support for the
DROP OWNED BY command, but that's left for a future patch as I expect
some amount of discussion to go about it.

Also, I removed the code that was doing de-deduplication of the object
addresses we collect, now trusting performMultipleDeletions() not to
screw us up. There's a use case that needs particular attention here,
though:

    DROP TABLE foo, foo;

I'm not sure we want to deduplicate foo in the pg_dropped_objects()
output in that case, so I've not done so in this version of the patch.
Also, Álvaro is concerned that the cost of deduplicating might be higher
than what we want to take here.

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


Attachment: sql_drop.1.patch.gz
Description: application/octet-stream (7.1 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Pavan DeolaseeDate: 2013-01-30 18:07:41
Subject: Re: lazy_vacuum_heap()'s removal of HEAPTUPLE_DEAD tuples
Previous:From: Simon RiggsDate: 2013-01-30 17:26:26
Subject: Re: pgsql: Fast promote mode skips checkpoint at end of recovery.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group