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 1v3yhg-006TD6-CT for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 15:25:16 +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 1v3yhe-003xBL-E5 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Oct 2025 15:25:15 +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 1v3yhe-003xBD-4I for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 15:25:14 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3yhc-000tdP-0m for pgsql-hackers@lists.postgresql.org; Wed, 01 Oct 2025 15:25:13 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-634b774f135so10382366a12.2 for ; Wed, 01 Oct 2025 08:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759332311; x=1759937111; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4AWhvuzMOWZTmiUgpHlTwPc9SxLOqAbETyVx84T20Os=; b=leuylx7LMrLJxQklbdOtQNHP44VGlg8dgN5ICH7kPx7phmqR8iTgRDNIrmGtGIexMa DLz4A301ZJYkS4+ki3oNyIdSVUJjLZWv2nw+jLn8ET/Ku5HOOXJLZNG5CRIMyH45Cgwm U6n19ba33HVeE739hZwOTOsTPfRFSg9fBgQcjOlc3YJU7Xqu1X+Nyr3TkYyyS6fWEEEy fuYGIDXNHYhrg/cXqTk/k3GS+U1j4zZrRrLE6Sl1MD22avsKbCj91VVi/y7gcpRV2VwQ r+ZJyz7t/ObbdhwlSoDTFW/jiEGCQqS4xGgKsvVW9HkibLilh7Desmzdr/BMbhZf3WG+ OwPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759332311; x=1759937111; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4AWhvuzMOWZTmiUgpHlTwPc9SxLOqAbETyVx84T20Os=; b=Tq8MFSeBc4rm11jgJih3FObs4HAPwLSOuvUgcUe3Q6DXe137Hnwu3tuBehILSLzu/2 5NE/T3lX7QgsjyjhMLtuqDkQKWDoDLuCeX7SqVwJEZWd+oujrpPksyjlL8rliVAgg4A0 Nj+qbzm4J4lvm5grkT/p8vuYiDpy1OHdVV5fztpSxglDxkREGCEBBE1jEJfsE12s6+h/ O3LpTV8SGVYpvXoftN/uOAHhLB62NTCu2rexkxrPnPTLRtEsBg+qrMcelzpE4IxJRtVD eqHL6NvUXlQ9e68gXX5DRzAeppS2zF4E5XWCovUqUdNPHwqWvsWSgCou+nF80o7DXW4K LdkA== X-Forwarded-Encrypted: i=1; AJvYcCWPymL/PYKNPjH5Xw7nrt7aC44Im7YWinJKXAd1hm2HHySR2ybVLg+1qEZdbjsLlWUPMWhWsKkG1d6aEHAy@lists.postgresql.org X-Gm-Message-State: AOJu0YwF0PDAxuWAGHTPdZQSvTHy/An80T/G+PyQv6WLNw5w5C3ZQRgd OC54bwGuXL1ViUcY2P7bWiGdKny6awXZ8KcNEDxhLk3n0dbaNio+OiATQvfhxA== X-Gm-Gg: ASbGncvf9oFewkkOlrMigNQgbnJJbXMkvk70/cBtsD3PEoA/US0znnJerqBLJR2eKfP 4pWvC9fQjvZ07fImiHMKIPHFbamdYkzviJ8nzN8lrEGD6ndswaSW8pZWWyPeWU92Yau44hQohP4 CH7anfZtCLPzsnNZAuuXaPGFM5xAFNDiVz2KQOC23/qXwCUSo1oo5iQcXIzcJOAvWngE7YJDKqH pi3ySXU752QBXkgA3t5ZjYdBF5H4xLK5zmKvx3m8aS4L3QsmVq0wfZMZr5ZWXd642b8WNLd9CRl QaSdiTlZiGMyiE/54UrKpDIgufnAn1GSXotPQyylhWHy2lZ/aGRrtQCQNxsef6JXru2+5pkAXMG QwgsF4MbaoyR1OW0GvFHDR2WoEXUwwt7bIlsgnMdm1/m0ayqfqCwa1vaPI3ZM3UK83b2/NSj9l7 JthSgSgcGoGZaRi+tDWkYOB+ozEXdkDeHq6tXzVW+gd41UUQRnoSnFYlOCEWCbIIHfirmfiNTs8 X4ePg3dqltSgjA= X-Google-Smtp-Source: AGHT+IHjfH4fzrNk2+aAV3QPBwrjsqg/KBj2gVq189UpQ3ZtJ9GgyuLcp8vLdwFulqItHoq+kGsemA== X-Received: by 2002:a17:906:a442:b0:b48:730:dbb3 with SMTP id a640c23a62f3a-b480730e7cdmr110205566b.32.1759332311296; Wed, 01 Oct 2025 08:25:11 -0700 (PDT) Received: from smtpclient.apple (2001-1c04-0681-7700-b92f-1913-bb55-ff37.cable.dynamic.v6.ziggo.nl. [2001:1c04:681:7700:b92f:1913:bb55:ff37]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b3f1b54c4fesm639886966b.86.2025.10.01.08.25.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Oct 2025 08:25:10 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: The ability of postgres to determine loss of files of the main fork From: Frits Hoogland In-Reply-To: Date: Wed, 1 Oct 2025 17:25:00 +0200 Cc: Laurenz Albe , Aleksander Alekseev , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <013D63E2-5D75-492E-85FF-1D5CC0148C82@gmail.com> <45b3a1dd6be28dd409850a5503c029a97ca0754e.camel@cybertec.at> <483AD9AA-39C1-4F4B-B0D6-4CBA0014E877@gmail.com> <083a4d75ab127a603743058bce26e79ba793494e.camel@cybertec.at> To: Andres Freund X-Mailer: Apple Mail (2.3864.100.1.1.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 1 Oct 2025, at 15:49, Andres Freund wrote: >=20 > Hi, >=20 > On 2025-10-01 15:39:04 +0200, Laurenz Albe wrote: >> On Wed, 2025-10-01 at 13:58 +0200, Frits Hoogland wrote: >>> I am proposing the database to have the ability to detect when it = has missing segments. >>=20 >> Just a random idea: one solution would be if each segment has a flag = that indicates >> if that is the last segment or not. But that would break the on-disk = storage format, >> unless there is room left for an extra flag somewhere in the current = layout. >=20 > It'd also make extensions / truncations more complicated. I rather = doubt we're > going there. Right now relation extension aren't WAL logged. While = there might > be reasons to change that, I don't think this is enough justification = for > doing so. >=20 What would be a achievable way of making postgres under the relation = size? How about a field in pg_class that keeps the final data page, so that = the catalog keeps the size, which then allows utilities and the database itself to = understand how many segments should exist? > Greetings, >=20 > Andres