Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oazmw-0001h5-TP for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Sep 2022 13:29:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oazmv-0006Fx-FZ for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Sep 2022 13:29:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oazmu-0006EX-W1 for pgsql-hackers@lists.postgresql.org; Wed, 21 Sep 2022 13:29:17 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oazms-0004uX-55 for pgsql-hackers@postgresql.org; Wed, 21 Sep 2022 13:29:16 +0000 Received: from [192.168.28.82] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 0802721C4789; Wed, 21 Sep 2022 16:29:13 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1663766953; bh=ttT77cbBgufGnFQnjlWC/CpniXNP6X5XHKt7tHYh0Oc=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Nx+yRsGdMbxSDFNFNxYm75OF+wJHqc+nu0LkXqf/vnd63H/kfd/b8gU6y1StZFXEZ 00VRa9VPj5iyfEmwwAiVfL3rzFB4vHbvkGy7uITSVZYB+3Jcq+oo6zLRuj42WSfrQp FrlbcGuEfqNDTfCeIliSY9ITO/JdvMEN0N9L5ZSY= Message-ID: Date: Wed, 21 Sep 2022 16:29:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: On login trigger: take three Content-Language: en-US To: Daniel Gustafsson Cc: PostgreSQL Hackers , Ivan Panchenko , Andres Freund , Tom Lane , Greg Nancarrow , Teodor Sigaev , Ibrar Ahmed , vignesh C , Pavel Stehule , Amit Kapila , Masahiko Sawada , a.sokolov@postgrespro.ru References: <2E4E472A-69F8-4EAC-B337-3341AC2F0188@yesql.se> <3378A73C-4441-43C7-B8F8-1B3611505524@yesql.se> <20220328213125.omlbcyzngqztxnyi@alap3.anarazel.de> <1648639288.568040808@f194.i.mail.ru> <3A419032-B266-4DD8-A6E8-F1EB1048B435@yesql.se> <491AA22E-BA4A-46D0-852E-3784A8CC842E@yesql.se> <66d83d70-ba5e-11a7-c5b6-a7ecddaf1281@postgrespro.ru> From: Sergey Shinderuk In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 20.09.2022 17:10, Daniel Gustafsson wrote: >> On 20 Sep 2022, at 15:43, Sergey Shinderuk wrote: >> There is a race around setting and clearing of dathasloginevt. > > Thanks for the report! The whole dathasloginevt mechanism is IMO too clunky > and unelegant to go ahead with, I wouldn't be surprised if there are other bugs > lurking there. Indeed. CREATE DATABASE doesn't copy dathasloginevt from the template database. ALTER EVENT TRIGGER ... ENABLE doesn't set dathasloginevt. In both cases triggers are enabled according to \dy output, but don't fire. The admin may not notice it immediately. -- Sergey Shinderuk https://postgrespro.com/