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 1nIXxl-0000hQ-7P for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 15:35:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIXxj-00021T-Qo for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Feb 2022 15:35:55 +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 1nIXxj-00021K-HW for pgsql-hackers@lists.postgresql.org; Fri, 11 Feb 2022 15:35:55 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nIXxg-0006cc-Cs for pgsql-hackers@lists.postgresql.org; Fri, 11 Feb 2022 15:35:54 +0000 Received: by mail-il1-x132.google.com with SMTP id o10so7187526ilh.0 for ; Fri, 11 Feb 2022 07:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=S3n0zskAJEpihsrhsAxDpZIbFQFHLpL6BXg6EIJ/400=; b=NGMfI57HJn2OvWqNwzeaettbRoltkCjceBME5kA9VyRAphvsYH511WD0ETdH1wgmd1 03fuhDUlZoniVBrLgrvowupbPjdwqqqrS14dYqrDaRTS0J0KSoLgZkg5Xg1m7v+6i4r4 yD30mHgfog5H301OjDjkU9zJI5qrl7dxaZUr3EbGR3nRn2Xr/qlXK33j1nw4oOtvhEie Se2s8NH4DplE7N5LkhliFELSkUhLd9xAfDlm55OhWzgW5wBNhxcYLU+DFvGJVEM/q/pH lU0GclEDQT52xL/Ix9amMOh3RCY1YiCv2FoTi7IcjZSvpRaik2SAnTuGB+qKrzu4dEBh RHow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=S3n0zskAJEpihsrhsAxDpZIbFQFHLpL6BXg6EIJ/400=; b=hSIjWb/JmD6YYyHiZPLP8FVFg643Gjgd0FWmuFBXLNedE7ViwgC8jerk5CQFD8VwHj JxlCuOahJoIvBdJ2gW8ChTJ0eoLtSxudXQz01Hz5MMeAoNqJtP50WWQ/NJaF2MgpcmCQ oUBAhLrEsYjrBg/Y7jamwRHuu8tlCIVk0Px40TKvqnUu5PN2Mm/zW2vU69FcaX1l4EnK th8CGknxW1hVuqhR7oHC2ahZM6/fX1MDHXNF101Rjg6uPtgZfMetTey8C3jRWShzh/5r 4LtlQRImrOwXcVXbhfCH7flXgdN0+BseWNNT0sp5l4IpSTPCsqASpuTE02PAf8JT0AqK PZpw== X-Gm-Message-State: AOAM531MZoJ8GncUJNPvroaqBx0S1OnpkOZIq5vMEoWhskxrUzgPU7h9 /5iH1CnX1OYqASXmW1xdGv4ozw== X-Google-Smtp-Source: ABdhPJxD786jeJKZH8qdUxwAiXF2WLhJXljfdayNRm8NNyiMEnT1gx5VYi/6PPJacCJmCj9vfRnR1g== X-Received: by 2002:a05:6e02:1a46:: with SMTP id u6mr1201274ilv.245.1644593750693; Fri, 11 Feb 2022 07:35:50 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a10sm13395531ilv.44.2022.02.11.07.35.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Feb 2022 07:35:50 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A50EE800A8D; Fri, 11 Feb 2022 09:35:49 -0600 (CST) Date: Fri, 11 Feb 2022 09:35:49 -0600 From: Justin Pryzby To: Tom Lane Cc: Christoph Berg , Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc Message-ID: <20220211153549.GE31460@telsasoft.com> References: <2023925.1644591595@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023925.1644591595@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 11, 2022 at 09:59:55AM -0500, Tom Lane wrote: > Christoph Berg writes: > > this test is failing at Debian package compile time: > > Could not open /usr/share/postgresql/15/postgresql.conf.sample: No such file or directory at t/003_check_guc.pl line 47. > > > So it's trying to read from /usr/share/postgresql which doesn't exist > > yet at build time. > > > The relevant part of the test is this: > > > # Find the location of postgresql.conf.sample, based on the information > > # provided by pg_config. > > my $sample_file = > > $node->config_data('--sharedir') . '/postgresql.conf.sample'; > > This seems like a pretty bad idea even if it weren't failing outright. > We should be examining the version of the file that's in the source > tree; the one in the installation tree might have version-skew > problems, if you've not yet done "make install". My original way used the source tree, but Michael thought it would be an issue for "installcheck" where the config may not be available. https://www.postgresql.org/message-id/YfTg/WHNLVVygy8v%40paquier.xyz This is what I had written: -- test that GUCS are in postgresql.conf SELECT lower(name) FROM tab_settings_flags WHERE NOT not_in_sample EXCEPT SELECT regexp_replace(ln, '^#?([_[:alpha:]]+) (= .*|[^ ]*$)', '\1') AS guc FROM (SELECT regexp_split_to_table(pg_read_file('postgresql.conf'), '\n') AS ln) conf WHERE ln ~ '^#?[[:alpha:]]' ORDER BY 1; lower ----------------------------- config_file plpgsql.check_asserts plpgsql.extra_errors plpgsql.extra_warnings plpgsql.print_strict_params plpgsql.variable_conflict (6 rows) -- test that lines in postgresql.conf that look like GUCs are GUCs SELECT regexp_replace(ln, '^#?([_[:alpha:]]+) (= .*|[^ ]*$)', '\1') AS guc FROM (SELECT regexp_split_to_table(pg_read_file('postgresql.conf'), '\n') AS ln) conf WHERE ln ~ '^#?[[:alpha:]]' EXCEPT SELECT lower(name) FROM tab_settings_flags WHERE NOT not_in_sample ORDER BY 1; guc ------------------- include include_dir include_if_exists (3 rows) -- Justin