Re: Triggers with DO functionality

From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers with DO functionality
Date: 2012-02-24 20:01:01
Message-ID: CAFNqd5Wwt78X46UB7pj7snNBxayhvXqhyG5xM9QF__-+AP2NSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 24, 2012 at 2:55 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> By default, a trigger function runs as the table owner, ie it's
> implicitly SEC DEF
>> to the table owner.
>
> Really?  That's certainly what I would *want*, but it's not what I've
> seen.

Yeah, not quite consistent with what I've seen.

And it's not obvious that it truly is what you want. An audit trigger
would need to run as the *audit table* owner, which might not be the
same as the user that owns the table on which the trigger fires.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message amit sehas 2012-02-24 20:45:41 Behavior of subselects in target lists and order by
Previous Message Kevin Grittner 2012-02-24 19:55:01 Re: Triggers with DO functionality