Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs4NN-0000ra-CW for pgsql-admin@arkaria.postgresql.org; Tue, 21 Aug 2018 10:59:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fs4NL-0000Eg-TR for pgsql-admin@arkaria.postgresql.org; Tue, 21 Aug 2018 10:59:03 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs4NL-0000EW-M4 for pgsql-admin@lists.postgresql.org; Tue, 21 Aug 2018 10:59:03 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fs4NF-0002Hp-Ov for pgsql-admin@lists.postgresql.org; Tue, 21 Aug 2018 10:59:01 +0000 Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz Received: from [IPv6:2406:e001:953:1:f941:2653:7177:9aa8] (unknown [IPv6:2406:e001:953:1:f941:2653:7177:9aa8]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 8E31E80A10 for ; Tue, 21 Aug 2018 22:58:48 +1200 (NZST) Subject: Re: How to enable Logon Trigger in postgres? To: pgsql-admin@lists.postgresql.org References: <1534758116021-0.post@n3.nabble.com> <1534763276887-0.post@n3.nabble.com> <1534830364258-0.post@n3.nabble.com> From: Mark Kirkwood Message-ID: Date: Tue, 21 Aug 2018 22:58:48 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534830364258-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 21/08/18 17:46, pavan95 wrote: > Hi all, > > Thanks for your responses. But to my wonder why can't these logon, logout be > events for a postgres instance. If they are like any other > INSERT/UPDATE/DELETE we can go with the triggers(logon trigger like in SQL > server). > > It will be great if postgres 11 includes this feature in its native release. > > It is certainly *possible*. But right now the event matrix - described here: https://www.postgresql.org/docs/10/static/event-trigger-matrix.html does *not* include logon/logoff events. Given that 11 is just about to be released, it won't include such a feature either. Now just to be clear, what you are asking for makes sense - having direct access to logon events rather than scraping the log file after then event - is a nice idea...we just don't have a patch to do that for version 11 (or 12) right now. regards Mark