Re: Trigger execution role

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Trigger execution role
Date: 2021-02-12 17:58:22
Message-ID: 1558725.1613152702@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Isaac Morland <isaac(dot)morland(at)gmail(dot)com> writes:
> I was trying to use triggers, and ran into something I hadn't realized
> until now: triggers run, not as the owner of the table, but as the user who
> is doing the insert/update/delete.

If you don't want that, you can make the trigger function SECURITY
DEFINER. If we forced such behavior, there'd be no way to get the
other behavior.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-02-12 18:10:52 Re: pg13.2: invalid memory alloc request size NNNN
Previous Message Tomas Vondra 2021-02-12 17:53:03 Re: WIP: WAL prefetch (another approach)