Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jBxDP-0004kA-Fu for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 08:59:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBxDO-0000jF-AW for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 08:59:46 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBxDO-0000bb-0T for pgsql-general@lists.postgresql.org; Wed, 11 Mar 2020 08:59:46 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jBxDL-0001Mh-Ua for pgsql-general@lists.postgresql.org; Wed, 11 Mar 2020 08:59:45 +0000 Received: by mail-ed1-x541.google.com with SMTP id a24so1903170edy.7 for ; Wed, 11 Mar 2020 01:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:reply-to:to:date:mime-version :content-transfer-encoding; bh=JKv1kFIL7bv8PHiP2T76/Gxfz6RcIELTlE6haxrd0KU=; b=FCGRrj0Y7FCW1WzFS1fhk4C3GWtN9rOrUKYKbS6RNg7RQVnfsAf4xBI4IPfBtpJQaV C3fvra5ZhX6ParToT3F2tCXGNjuC0Pco8wuMAWpJ0TwEPrQP/XO/GWFZCls/YFIQvwaR WyyF/io0U0Y0zcB/OCvLfnv0EpYQSdOLaQfID2tW3KWSvuVE4ctE4mETohdpPqClPG1B SgZrPCdK/P5JT+ONHQlh9lfqlFZAcpIwzHXwBfELzuKi+Psd/hR3HRCsjnsKRaTR6p6F eH1Yf8b0NQScC15Xe/+uC96nXYNasDtodUai/NwTpK+/CiYJuoLlRmzJg6xNepJIEHOi BWIQ== 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:reply-to:to:date :mime-version:content-transfer-encoding; bh=JKv1kFIL7bv8PHiP2T76/Gxfz6RcIELTlE6haxrd0KU=; b=PsmX7gW/ZlLoSvfDyc0hy1NwR/WfgA3534hkXRaPmEWG+dnkOAAKbD1nO4TcgYEhrk s8ud6dW5T2KFNfaHSsyzuv0KUWWMVYELVbE4Eeg26fZrPSAYor7+U+o7lyjz4dfwM/Cu M5+quhZZxyOLKN2Un0kd9arUkdfQ1bTKoXiZlfDvc9w8nZr7t4ENT6THc9EObKhxnJ1t CEzLfv9tKMEOtOZHkcF/oFTyB6n6Lh2acRh4qtaDgkTYQwb8SS/8a9xCuAeKBmtmVteP ES+iqSNvOdPo7O7sLN28xabpwzt0w1tPRCiI6/gzcThg+8IKy8aWXAnPyZF/wknjF6J+ gpsA== X-Gm-Message-State: ANhLgQ1MaVfDx5fTGDpoyDT5FZnVTTgA7iT4C7Kk99QSy7So4AItB9Af pLigX2+PTGzA9tF9q4WTbk0EWEJU X-Google-Smtp-Source: ADFU+vvOR/UTKppm23GqvYzk0Ne85ZcoMIT+rdb0qhj7d8zyVHKNQPImW0KgDSJaoi4SAo3TP7313w== X-Received: by 2002:a50:ed18:: with SMTP id j24mr1851741eds.124.1583917183147; Wed, 11 Mar 2020 01:59:43 -0700 (PDT) Received: from torstenknbl ([2a02:810a:14bf:e8f0:8105:a40a:5ac5:beb2]) by smtp.googlemail.com with ESMTPSA id c18sm4058016edv.4.2020.03.11.01.59.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Mar 2020 01:59:42 -0700 (PDT) Message-ID: <3f91429eb65ac8aa3c77361c587e786a290b92f0.camel@gmail.com> Subject: Force WAL cleanup on running instance From: Torsten Krah Reply-To: krah.tm@gmail.com To: pgsql-general@lists.postgresql.org Date: Wed, 11 Mar 2020 09:59:41 +0100 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, I am building a docker image with a postgresql 12.2 instance and while doing so and importing a dump and running some update scripts wal size is increasing. When finished I don't need all those wal files anymore and tried to force the daemon to clean them up and tried this: select pg_switch_wal(); CHECKPOINT; and did wait for a minute. Sometimes it works and wal files are cleaned and moved away so my image size is way smaller - but it does not happen always in that minute. So is there a way to tell postgres to force the housekeeping of the wal stuff via a statement / command line tool? In a "normal" running instance it just takes care of itself and it will happen sooner or later and it doesn't really matter when that will happen - but with my docker image which is automatically build it would be nice to have a deterministic way of trigger that to reduce the final size image. Is there some way to trigger this? kind regards Torsten --