pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: stan <stanb@panix.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Detecting which columns a query will modify in a function called by a trigger
Date: Mon, 2 Mar 2020 11:02:54 -0800
Message-ID: <30c3c06e-61fa-3210-666d-1696af320a75@aklaver.com> (raw)
In-Reply-To: <20200302185904.GA6528@panix.com>
References: <20200302185904.GA6528@panix.com>

On 3/2/20 10:59 AM, stan wrote:
> I need to implement a fairly fine grained security model. Probably a bit
> finer that I can do with the standard ownership functionality.
> 
> My thinking on this is to create a table that contains the users, and a
> "permission bit" for each function that they may want to do, vis a vi
> altering an existing row,or rows, or inserting new rows.
> 
> Looks relatively straight forward, if fairly time consuming to do. But I
> would need to know which column(s) a given query would add..alter from the
> function to implement this via a trigger. looks like I see most of what I
> need t do this in the docs, but I can't quite figure out if I can get this
> down to what column(s) a given trigger will modify. Is this possible?

Before you get too far into this I would look at RLS:

https://www.postgresql.org/docs/12/ddl-rowsecurity.html



> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (17+ messages)  latest in thread

Message-ID: <30c3c06e-61fa-3210-666d-1696af320a75@aklaver.com>
Permalink:  ../30c3c06e-61fa-3210-666d-1696af320a75@aklaver.com/
Also on:    postgresql.org/message-id/30c3c06e-61fa-3210-666d-1696af320a75@aklaver.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: adrian.klaver@aklaver.com, stanb@panix.com, pgsql-general@lists.postgresql.org
  Subject: Re: Detecting which columns a query will modify in a function called by a trigger
  In-Reply-To: <30c3c06e-61fa-3210-666d-1696af320a75@aklaver.com>

* 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