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.98.2) (envelope-from ) id 1x9gIY-00000002AGb-0aOQ for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 10:03:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x9gIX-0000000AnHL-0ZFw for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 10:03:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9gIW-0000000AnHC-2jG4 for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 10:03:24 +0000 Received: from mail-wm2-x10.google.com ([2a00:1450:4864:31::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x9gIU-000000012Ox-0hK2 for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 10:03:24 +0000 Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49b912d3920so12795775e9.1 for ; Thu, 24 Sep 2026 03:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790244201; x=1790849001; darn=lists.postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=nfptnSyPV3i+F8mykQ73hKxVDeV2QLj3bwvnRPecHR8=; b=kBYwNg7mgBX5KpfBcLHnwC3M2nMwoxVU71C0QavWeo8FL7SYsXeXgzJIiiC6XHZpBN k9m7iujtmCl6gqdkBf2Sux0SzRvn51bMr5BKtBgXEYOTC4nYqa35cZR3n+AnvBz4xUHM qObUwu/kw560RCf7428aMxfoih+zyZ1+3RZAE8LGbJ6tDainyt+iZWkME482SR+hK6X6 kYr2VXabVa8wslkothgqCGqYoVzqkXEmn4YSMpeU1z7qNBk+wrV1k//LYtFMtlChszbX bxenz5lz9VP5gIscZliG5172kItWKTIOFgaD0EbzJ/rkS/HLQT6ZMrx5QJkrxS4v/ee6 Gu8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790244201; x=1790849001; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nfptnSyPV3i+F8mykQ73hKxVDeV2QLj3bwvnRPecHR8=; b=Zuap5MRADP/lhQZGY8Oap1aZ4QaA6MnFbCikppIdCM+wYA6OdwYhQqCNRWhGDatgB9 +X/5uq5T9OscwErkf5Ig0/VjKzIgcfHd8ACdkhee7jwW08iOibLbMkm89RwVmdvB9rPB UNcriPB5OjDCWCvDaz8FqbAOE5PH5nbKFUjXpHT9tKalrU0yOcxzfV5X8lZ92IOQep6j uwf4Oe8yzpZVHvcDxPU6eLgIPgdil1n+QIho9CkBMIeOCeiwgPFTs3o5ivTZZdTJ/Mcx 2lOo5hRCLWJciVVfFqRMQLdCIDhMFiZhpe/MnVchD1wfcvNh1oKhJEBfu38dvtD+CnvU M9tA== X-Forwarded-Encrypted: i=1; AKwUvBwNLI05TaXb3K73MjzkaLH76T/TTpoHTFfGWZzXD5VSR6DWDkHOcDvbTEte/XqPCvfbGSta0Bfo3ZXHkCry@lists.postgresql.org X-Gm-Message-State: AFuF++kgOOZ7+AYyrCIZwqS0m8XnPLvn2wcJ6zG3KKKVYs31F1ep/oh0 PETpBGl++lLSOnp9SqQFCStM50iyc16CzKj8/ez7OEOY6gP4z/oRYKm9 X-Gm-Gg: AYBFou1rDl8YOsmQOwlg9lF81eOR9Zcgt1H+wbHnhXwRibGCudvMwvYgo23+A+MHByE eEjxK8DFFc4zKp+UonYlHzuz/HvfjtXHFzdPQpnXC/kQ9gYbzuiU5bkCLpQjQ3CDZ8kXo0LPTDw tJtBKb0K/dwyRFliNUE7zVG4WABeHEzcmeiMd3lzx1cFpV/NSyhAArwvqv1VCYes1uy6QLzJ+zb Ajx8PXN/+tR+FDHrSwM/eUzq0hJr8wew4/F3CVmO/oIfnzNxlaICONO1VaYOX+r+TTT/yeHkCzu J/w4BE2iojIfX4bDDDFThDDUh9YM/R2XYF8lg/9qMfQLux3hpb//05wG3vLjY9nJxPq1yHDXlhe acl4HcWKOgr2JgEZoCn4jbHfUXgi1yweqyNHn8O+r555Zri5wlyjC3Sp+lII+NNR8258Hcb5J8e gYgXk9ZYdKhVVZyhczgel/UJMp9zZHwlztdfkKV1OjuQWhvKcLGHRqXFgdStAlLE0DsADpOhqjR wjqwBRi1tpm6sdcJ3/9xCA6TR5keYUSEyAg3suWTpsDb5BtY3EKDPtoJw== X-Received: by 2002:a05:600c:8b26:b0:499:8ff5:8ecc with SMTP id 5b1f17b1804b1-49fe66d83camr36900865e9.15.1790244200607; Thu, 24 Sep 2026 03:03:20 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c4054fsm101797255e9.3.2026.09.24.03.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 03:03:19 -0700 (PDT) Date: Thu, 24 Sep 2026 10:03:18 +0000 From: Bertrand Drouvot To: Zsolt Parragi Cc: Andrey Borodin , pgsql-hackers@lists.postgresql.org, Ashutosh Sharma Subject: Re: Orphaned Files in PostgreSQL Message-ID: References: <3BB5E75C-A374-4439-B60F-A539FDAE2055@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Sep 23, 2026 at 03:10:27PM -0700, Zsolt Parragi wrote: > Hello! > > This issue is also related to a recent discussion about online > checksums[1] and I tried to look into possible solutions into it when > investigating that, and I agree that it should be improved. Indeed. The proposed approach could prevent new orphan files, but it would not address existing ones or "relation looking" files "manually" added to the data directory. While the latter can be considered unsupported, they can trigger the same base backup verification failure. FWIW, pg_orphaned [1], already provides functions to list, quarantine, restore and remove such unreferenced files. I wonder if it would be worth considering adding pg_orphaned, or part of its functionality, to contrib, independently of this patch? [1]: https://github.com/bdrouvot/pg_orphaned Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com