Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j8qHd-0000Iy-MG for pgsql-general@arkaria.postgresql.org; Mon, 02 Mar 2020 18:59:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j8qHa-0000st-RX for pgsql-general@arkaria.postgresql.org; Mon, 02 Mar 2020 18:59:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j8qHa-0000sm-Ht for pgsql-general@lists.postgresql.org; Mon, 02 Mar 2020 18:59:14 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j8qHT-0001EQ-Ir for pgsql-general@lists.postgresql.org; Mon, 02 Mar 2020 18:59:14 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 48WTvX5YnpztrJ for ; Mon, 2 Mar 2020 13:59:04 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 17622) id 48WTvX3tFNzfYm; Mon, 2 Mar 2020 13:59:04 -0500 (EST) Date: Mon, 2 Mar 2020 13:59:04 -0500 From: stan To: pgsql-general@lists.postgresql.org Subject: Detecting which columns a query will modify in a function called by a trigger Message-ID: <20200302185904.GA6528@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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? -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin