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 1mKksT-0000Zn-7Z for pgsql-admin@arkaria.postgresql.org; Mon, 30 Aug 2021 17:15:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mKksR-0003tu-3F for pgsql-admin@arkaria.postgresql.org; Mon, 30 Aug 2021 17:15:19 +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 1mKksQ-0003sx-NK for pgsql-admin@lists.postgresql.org; Mon, 30 Aug 2021 17:15:18 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mKksJ-0008D4-Ev for pgsql-admin@lists.postgresql.org; Mon, 30 Aug 2021 17:15:18 +0000 Received: by mail-wr1-x430.google.com with SMTP id t15so17258509wrg.7 for ; Mon, 30 Aug 2021 10:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=g4+yukKR4O4hMm/edA4XQNgqQReJRopWBtVYxjOlNBU=; b=WLa7afOzwAC09HIE4N3XMe2VmlIgyoOLgzuvwoZHmdQJhLCVkMHHXi5NpNrzR6HPjc wszGnzcIO6LN+WUrj/zdHOtPDp/CyEnTSZ8DtQVqis/dJlt8MTcY45PcSOYFI9zSRw6x zHHGSb5mhkDBRBmKNGOm+ZmkaUoCE16+eVQ0UBa8RxruIXqbW7aPb2vpQA0v/+e8Vvpa 0RwfIZkNkhVq4jT3vz9U1t+hOb9cheIWzgO0lQ1RmtrJ+bBK0QmTvr93TfhBFZwmHU2c KSWhe7GCB6Tx0FSdzostBytqRW2Pss2hRKUGzbhF6MplOGAxgla3UTS7CNHbRjfiisfd l2JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=g4+yukKR4O4hMm/edA4XQNgqQReJRopWBtVYxjOlNBU=; b=KIfojVg87iEpzav6Wtqf4h9eio2TVFkh+mKkkNjWe9KNXZ4NhGOa5zQIVMGjtQGQhL /5g3Dx7xbvQRlINA5fAl7zRPWX1HqcMk+gzv3rZEjTMq/Sf9SNb/ieDnli5qw9+gf5tm hk5H9TTWubZGmz9g2QBbtlqg76p0QWIT0fHBuB+fSAqGZMDQOTpN13v1/8j2YxqdIWo1 U40w3M8SC+uezKabhN4OlEtQ+4rNvvRMaFrlFy+0DuUNFMJhd9KYmGvAJ6amLC9RTv1M weuX6GvOsTxgda7DBuyQwRHJdSjkM6/hU5zYzIBNeghCa+U7o7oF1+6zrPw4BkGNro4u QE0g== X-Gm-Message-State: AOAM533MzEerDFQkGbOgobFPJFgQAe5hJDyOSjyE54yQYWvE0T+x7XZx oZfpG2sIM4Ur7hK5lUlOaPIi5sshniaxaA== X-Google-Smtp-Source: ABdhPJyyedb25sruzGiyfLhHtZFPPHsfFtFHh4baHxNvpaa7lFTarV/kZbc22hmQmMJuUiZw6mHELw== X-Received: by 2002:a05:6000:1010:: with SMTP id a16mr27647580wrx.70.1630343708858; Mon, 30 Aug 2021 10:15:08 -0700 (PDT) Received: from localhost.localdomain (dynamic-e0r6tpdevjvdg5mlb-pd01.res.v6.highway.a1.net. [2001:871:5c:4db9:cf7b:7421:7101:159f]) by smtp.gmail.com with ESMTPSA id o7sm68117wmc.46.2021.08.30.10.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 10:15:08 -0700 (PDT) Message-ID: <9395a02bc37b8c7a3ca09441d288ff49e1c19c39.camel@cybertec.at> Subject: Re: vacuumlo From: Laurenz Albe To: Ian Dauncey , "pgsql-admin@lists.postgresql.org" Date: Mon, 30 Aug 2021 19:15:07 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2021-08-30 at 15:08 +0000, Ian Dauncey wrote:  > I did run the vacuumlo  against the pg_largeobject table without any issues but afterwards > I ran a vacuum full against this table which caused lots of issues. > Because the vacuum full takes an exclusive lock (which was my first mistake as I > did not stop the applications accessing the database) on the table I had all the > applications hanging. Right. > The next issue was it started writing out WAL logs and in the end the file system > which housed the Wal logs filled up causing the vacuum to fail. > Now the issue I have here is that the vacuum full created a temporary table , and when > it crashed this temporary table did not get deleted. I did rerun the vacuum full against > the pg_largeobject table (and yes, I did stop all the applications first). > It did complete successfully but it did not drop the previous temporary table. > This table is taking close to 100 Gig of disk space. VACUUM (FULL) will write a compact copy of the table, then delete the old one, so it temporarily needs more space. It may be a good idea to put "pg_wal" into a different file system, so that WAL space cannot run out even if the data files fill the file system. Then PostgreSQL won't crash, and the files will be removed.   > If I backup and restore the database onto a different server this temporary table does not get restored. > My question here is. >    1. How do I get rid of this temporary table without a backup and restore as this is our Prod system? You cannot :^( If you know PostgreSQL well, and you know what you are doing, you might be able to identify those files and manually delete them. But that's definitely not something for the casual user: delete the wrong file, and you have to restore the backup. >    2. Is there a way of finding out the name of this temp table and matching it up to files on disk? No, unfortunately not. You'd have to identify the files that do *not* belong to any table, and that is tricky. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com