Re: Clang compiler warning on 9.3 HEAD

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Will Leinweber <will(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clang compiler warning on 9.3 HEAD
Date: 2013-04-05 07:44:53
Message-ID: m2wqshpgju.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Now, it annoys me that we now have three places that know about object
> types supported by event triggers: there's a large struct of command tag
> substrings (event_trigger_support), then there's these two functions.
> It might be better to add ObjectType and ObjectClass entries to the
> struct, so that only the struct needs to know about that. The problem
> is that these two functions would have to walk the struct every time,
> instead of being a simple switch.

Back when I added an dedicated event per command, Robert asked me to
work on such a big struct containing all the parameters in the same
place. Then we got back to only a couple of events, and completely
forgot about that.

You can have a look at how it did look like here:

https://github.com/dimitri/postgres/blob/evt_trig_v1/src/backend/utils/cache/evtcache.c

And rather than walk the struct, I did install a couple of dedicated
hash tables so that you could do direct and fast lookups.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2013-04-05 08:19:19 Re: CREATE EXTENSION BLOCKS
Previous Message Dimitri Fontaine 2013-04-05 07:33:30 Re: [PATCH] Exorcise "zero-dimensional" arrays