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 1j7QpQ-0005gD-FD for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 21:36:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7QpP-00078k-8n for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 21:36:19 +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 1j7QpN-00078d-1j for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 21:36:19 +0000 Received: from [64.147.123.20] (helo=wout4-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7QpI-0000DX-6h for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 21:36:16 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9738E5E9; Thu, 27 Feb 2020 16:35:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 27 Feb 2020 16:35:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=3 Pw5RpzikmNhtD9FynJ9hqCwwztySfD74lFbuprp90o=; b=laOxXZa0XCdfmUClM fIek9/lg6S2EkRMaaDwuwlYh+glEZZI2pti8izHhiypKBPMcbfxmQaFO4msZUVd6 ET2SBl+K3z/5j+rWrQyYRbq3FTumyRRbrzVqbYZeBCzKyhZ9PrajRs9MOlPVFDdX kxnGCIQdZVWd3uXlD1DAACr2ADOxQOmOUGGfmowNwcc7WUwQ5I/Lgda4UzhkB5wx HkP5SuO9JQIR8pTDjH93jl8CdMdgN6G0EVEKhNo58QKKq7JzDRQCXp8Fm672phpO kUPa8ATLt9+ZqlO0OBPazEfpL9Vf9pqe86Wmxke7EFm7YqfwzSY4/qju/Igj2HAX nF+KQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=3Pw5RpzikmNhtD9FynJ9hqCwwztySfD74lFbuprp9 0o=; b=K1Q2yf6/txMy4G4gUdi+Nqlfza0pH7Yh39TAoBUM0hryr1qFtY69g3iRY JyFPJgy2zVqW3DhEccE5bwO2rJUN+79nFaQQxqoe0ZM3Eq6NGdvz+zvbmjtIvh66 2vBcDA15ktZ5yd3u/NNzHX48gxroleak9POL/DlgG1vvDe73YEGR6Sizt7UN2uB7 aGVxzTJJjY9uexnuVXZYrx1z5szdzylPhoD5j9GvKqmffXsd750vcet4lLiSa86W tkNSZ08s76aTSrLF8QGHiWnE3UXJCC7zhrDsyCRGzpGQyMkfGZ0+CJ+Dv+0jVown B85LDpR3lCXaNt8cadv8OG0oV9Hqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleeigddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepjedurddvuddvrdduvdelrdduleefnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 858A73280067; Thu, 27 Feb 2020 16:35:58 -0500 (EST) Subject: Re: A question relative to creating an audit table To: stan , pgsql-general@lists.postgresql.org References: <20200227212847.GB3663@panix.com> From: Adrian Klaver Message-ID: Date: Thu, 27 Feb 2020 13:35:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200227212847.GB3663@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.20 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/27/20 1:28 PM, 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. > > Can a function, called by a trigger, determine what table it was called > for? > Asked and answered: https://www.postgresql.org/message-id/CAKFQuwY=wXXLZBJMv5ULk4P4B5sF+fnZXWThp-UGERE-NxEb4w@mail.gmail.com -- Adrian Klaver adrian.klaver@aklaver.com