pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: raf@raf.org
To: pgsql-general@lists.postgresql.org
Subject: Re: Inserts restricted to a trigger
Date: Tue, 18 Jun 2019 10:47:28 +1000
Message-ID: <20190618004728.ph5aeg4wlucll7y5@raf.org> (raw)
In-Reply-To: <6fe78cce-7e74-926b-7d3d-2e09da698cc8@aklaver.com>
References: <CAALojA-Mn+V+j9gdS2-jyoCzAGrjwGQh2hJq0H1it5M4=UaHBw@mail.gmail.com>
	<6fe78cce-7e74-926b-7d3d-2e09da698cc8@aklaver.com>

Adrian Klaver wrote:

> On 6/17/19 4:54 PM, Miles Elam wrote:
> > Is there are way to restrict direct access to a table for inserts but
> > allow a trigger on another table to perform an insert for that user?
> > 
> > I'm trying to implement an audit table without allowing user tampering
> > with the audit information.
> 
> Would the below not work?:
> CREATE the table as superuser or other privileged user
> Have trigger function run as above user(use SECURITY DEFINER)

and make sure not to give any other users insert/update/delete
permissions on the audit table.

> > Thanks in advance,
> > 
> > Miles Elam
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com





view thread (12+ messages)  latest in thread

Message-ID: <20190618004728.ph5aeg4wlucll7y5@raf.org>
Permalink:  ../20190618004728.ph5aeg4wlucll7y5@raf.org/
Also on:    postgresql.org/message-id/20190618004728.ph5aeg4wlucll7y5@raf.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: raf@raf.org
  Subject: Re: Inserts restricted to a trigger
  In-Reply-To: <20190618004728.ph5aeg4wlucll7y5@raf.org>
  References: <CAALojA-Mn+V+j9gdS2-jyoCzAGrjwGQh2hJq0H1it5M4=UaHBw@mail.gmail.com> <6fe78cce-7e74-926b-7d3d-2e09da698cc8@aklaver.com> <20190618004728.ph5aeg4wlucll7y5@raf.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox