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 1nKOyz-0005kZ-OG for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 18:24:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKOyx-0005q6-Qz for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 18:24:51 +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 1nKOyx-0005pw-I3 for pgsql-hackers@lists.postgresql.org; Wed, 16 Feb 2022 18:24:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKOyr-0001nG-1P for pgsql-hackers@postgresql.org; Wed, 16 Feb 2022 18:24:51 +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 21GIOfsP3391408; Wed, 16 Feb 2022 13:24:41 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: initdb / bootstrap design In-reply-to: <20220216021219.ygzrtb3hd5bn7olz@alap3.anarazel.de> References: <20220216021219.ygzrtb3hd5bn7olz@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 15 Feb 2022 18:12:19 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3391406.1645035881.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 16 Feb 2022 13:24:41 -0500 Message-ID: <3391407.1645035881@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > Sure, there's a few tokens that we replace in initdb. As it turns out th= ere's > only two rows that are actually variable. The username of the initial > superuser in pg_authid and the pg_database row for template 1, where enc= oding, > lc_collate and lc_ctype varies. The rest is all compile time constant > replacements we could do as part of genbki.pl. I remembered the reason why it's done that way: if we replaced those values during genbki.pl, the contents of postgres.bki would become architecture-dependent, belying its distribution as a "share" file. While we don't absolutely have to continue treating postgres.bki as architecture-independent, I'm skeptical that there's enough win here to justify a packaging change. initdb is already plenty fast enough for any plausible production usage; it's cases like check-world where we wish it were faster. So I'm thinking what we really ought to pursue is the idea that's been kicked around more than once of capturing the post-initdb state of a cluster's files and just doing "cp -a" to duplicate that later in the test run. regards, tom lane