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 1qCZtL-00054v-R2 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jun 2023 06:03:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qCZtI-0007iG-VF for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jun 2023 06:03:28 +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 1qCZtI-0007hT-HG for pgsql-hackers@lists.postgresql.org; Fri, 23 Jun 2023 06:03:28 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qCZtG-0049iI-31 for pgsql-hackers@lists.postgresql.org; Fri, 23 Jun 2023 06:03:27 +0000 Received: from mail.postgrespro.ru (webmail.mstn.postgrespro.ru [192.168.2.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.pyhalov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id A63E9E20F0A; Fri, 23 Jun 2023 09:03:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1687500204; bh=1l0S/A2gBZcLEJfxY5+Lct8vpSS6NByyuqctGBrd8CY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:User-Agent: Message-ID:From; b=k8WcTuOQK7838aizLdzztl5p8hz6l+bvkdHNqhNecZf26wShskMiZa1yGOAIZ27JA jOCHbN4IK0G4peL0pXEIAPqZlxv6ALSOq5WLUR4iy4FAs3wz4cXgl+cgchaVqIIqnD 6Ucs7Fp109kK1V/BMarIP2LA8wSNvwuk87gvobfk6w5jdegD1+TSHOdVQZ91gsuvtK uKu+A+x5NHS+b6XlDzyVoTN4zaqaJB67zPCwokiOxVnj5qzJra90QHQTQLSqc5adsK 4y+wKpb/A8MiteVhdoXp6D46JSY5cb1ILNZfdA2BhhgQoQB3to2MkfsXc+ke4a9zkP WbdrrtX0eSrdw== MIME-Version: 1.0 Date: Fri, 23 Jun 2023 09:03:24 +0300 From: Alexander Pyhalov To: Tomas Vondra Cc: Andres Freund , Tom Lane , PostgreSQL Hackers Subject: Re: memory leak in trigger handling (since PG12) In-Reply-To: References: <222a3442-7f7d-246c-ed9b-a76209d19239@enterprisedb.com> <960113.1684859980@sss.pgh.pa.us> <20230524185559.un4dqfem3u3ktons@awork3.anarazel.de> <36e564f7-6cde-927d-9089-19471a05e8f3@enterprisedb.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <48e251869b7ef921b7f894a3c7cb154a@postgrespro.ru> X-Sender: a.pyhalov@postgrespro.ru Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra писал 2023-06-22 17:16: > On 6/22/23 13:46, Tomas Vondra wrote: >> ... >> >> I haven't tried the reproducer, but I think I see the issue - we store >> the bitmap as part of the event to be executed later, but the bitmap >> is >> in per-tuple context and gets reset. So I guess we need to copy it >> into >> the proper long-lived context (e.g. AfterTriggerEvents). >> >> I'll get that fixed. >> > > Alexander, can you try if this fixes the issue for you? > > > regard Hi. The patch fixes the problem and looks good to me. -- Best regards, Alexander Pyhalov, Postgres Professional