Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXMZc-005qkA-5y for pgsql-general@arkaria.postgresql.org; Mon, 13 Jan 2025 15:41:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tXMZa-00Axr1-Ru for pgsql-general@arkaria.postgresql.org; Mon, 13 Jan 2025 15:41:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXMZa-00Axqr-HC for pgsql-general@lists.postgresql.org; Mon, 13 Jan 2025 15:41:50 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXMZZ-000CES-0e for pgsql-general@lists.postgresql.org; Mon, 13 Jan 2025 15:41:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date:Content-ID: Content-Description; bh=Am4jaF/Og5oSy7v4lE2dadUVjOqcFkgxjjFXmUv/vTc=; b=j8b6/ 2Zv75zKC6aewXwZg/ooDw0NQgOfcrlHNWOW6A4PUIvRvn2NMgMiyPPirwGn8AQm4gfugaq3Srws8n l6pjnQAM1Q7MPVCH2zRd16ZZxyWNiMn992+njyttdJVMeLA8XhRw15e/6m972vaL+r4S/F+jT1Duj zyJn3OkV5jHY=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1tXMZW-00FJ7M-0K; Mon, 13 Jan 2025 16:41:46 +0100 Date: Mon, 13 Jan 2025 16:41:46 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: nicolas Cc: pgsql-general@lists.postgresql.org Subject: Re: pg_repack and locks Message-ID: Reply-To: depesz@depesz.com References: <1726378815.4209727.1736772006968.ref@mail.yahoo.com> <1726378815.4209727.1736772006968@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1726378815.4209727.1736772006968@mail.yahoo.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 13, 2025 at 12:40:06PM +0000, nicolas wrote: > Hello everyone, > > We are using postgresql v12 and added the pg_repack package > > Since I cannot stop other process, I use the “--no-kill-backend” and Pg_repack will wait indefinitly until pg_repack get the lock > > I get sometimes a problem of lock: > > sometimes, I get indefinitly this message : “NOTICE: Waiting for 1 transactions to finish. First PID: xxxx” > > this is a real problem because the database is usd all the time. > If I kill the process, a trigger on source table will still exist and temporary tables and type still exists in the repack schema. The tables are not empty if data has been modified in the source table during the repack. > > If I drop table repack tables, I will loose all data modifications done on source table > how can I properly cleanup the database ? Allow it to kill offending backends after some time? For example -T 7200? Best regards, depesz