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 1ponqR-00037m-Ce for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Apr 2023 16:06:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ponqQ-0000yX-5S for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Apr 2023 16:06:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ponqP-0000yM-SU for pgsql-hackers@lists.postgresql.org; Tue, 18 Apr 2023 16:06:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ponqN-000Wif-Hy for pgsql-hackers@postgresql.org; Tue, 18 Apr 2023 16:06:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33IG69Ng2661236; Tue, 18 Apr 2023 12:06:09 -0400 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: constants for tar header offsets In-reply-to: References: <2658038.1681832336@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 18 Apr 2023 11:53:08 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2661234.1681833969.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 18 Apr 2023 12:06:09 -0400 Message-ID: <2661235.1681833969@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Tue, Apr 18, 2023 at 11:38 AM Tom Lane wrote: >> 2. The header size is defined as 512 bytes, but this doesn't sum to 512: >> + TAR_OFFSET_PREFIX = 345 /* 155 byte string */ > I think that what happened is that whoever designed the original tar > format decided on 512 byte blocks. And the header did not take up the > whole block. The USTAR format is an extension of the original format > which uses more of the block, but still not all of it. Hmm, you're right: I checked the POSIX.1-2018 spec as well, and it agrees that the prefix field is 155 bytes long. Perhaps just add another comment line indicating that 12 bytes remain unassigned? regards, tom lane