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 1j7S2P-0007xH-TN for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 22:53:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7S2O-00054l-P1 for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 22:53:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j7S2O-00054d-CS for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 22:53:48 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7S2K-0005qL-Td for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 22:53:47 +0000 Received: from [10.8.8.13] (unknown [185.94.189.190]) (Authenticated sender: vik@postgresfriends.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id D779D100005; Thu, 27 Feb 2020 22:53:40 +0000 (UTC) Subject: Re: A question relative to creating an audit table To: stan , pgsql-general@lists.postgresql.org References: <20200227212847.GB3663@panix.com> From: Vik Fearing Message-ID: <828ea45d-3126-e5d2-a235-6b8415e5f202@postgresfriends.org> Date: Thu, 27 Feb 2020 23:53:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200227212847.GB3663@panix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 27/02/2020 22:28, stan wrote: > I ma considering setting up a function, and triggers to put a record in an > audit table when certain tables are altered. I pretty much think I know how > to do this, with one exception. There are extensions out there that deal with this for you. Here is one: https://github.com/xocolatl/periods/ > Can a function, called by a trigger, determine what table it was called > for? Yes. -- Vik Fearing