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 1nu3CK-00013i-PB for pgsql-hackers@arkaria.postgresql.org; Thu, 26 May 2022 02:26:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nu3CJ-0006SY-Mf for pgsql-hackers@arkaria.postgresql.org; Thu, 26 May 2022 02:25:59 +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 1nu3CJ-0006SO-Aj for pgsql-hackers@lists.postgresql.org; Thu, 26 May 2022 02:25:59 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nu3CF-0005rf-Ox for pgsql-hackers@postgresql.org; Thu, 26 May 2022 02:25:58 +0000 Received: by mail-il1-x135.google.com with SMTP id 3so270228ily.2 for ; Wed, 25 May 2022 19:25:55 -0700 (PDT) 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=SJojOMJjjymTU6JBRBIqH9towo7GhR4k2jQ0vGdqRmc=; b=ABWNDuIAUwNbvoXNIYUA5scj/s2QOf52XXsVkFMjm7wAS+oAElOQFohQRB1h9SntCU i8iBEHGa9ZLmEuPUo07F1n1PeJV0huoOaCftFbfxyjC2S6detB/7Mzw4NpiINTcWtwgL auPnZ6qFK43kcpJaMxHN0oXXqzpgNJvtc67whk2le8JMyWPSOspYYTTg1NAvLeeKYE6I cF8i7RWkVd9XpNPxlc8Hyh0u9CO+Hiy1MBrKjlLYkL0Cz4MzIYlys+mMEbhroi8UctKT qIpxD6SIXj+PWx96HifTZ3RPljRMc+GNE/M9KdNzO4z4e9ucjghujfa+7TdweX2jP2k6 UBvA== 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=SJojOMJjjymTU6JBRBIqH9towo7GhR4k2jQ0vGdqRmc=; b=1saNI/AoAfeM5tye3BgGDJE+BbBlLVRhOYeoAMXHoxBLFaksxlBOE0vGDp27e80N4s 4fUHwaSz3HfW8c/UBOY7vXIgaWFomHPfIZ3N2xUdxmzSli3TOvsgt/JHMR+DQEjDLMIE 7Jz9rWaOr6jlE6O6xy3WAdKm5Sayajn4gCuq31K4d6OPc5Va7qAjCkq6q/8rEdNclzbJ B++Ht9Ot1PIdNpu5aW4dgiz26PwxLzYhKOXVJQVMy0OTxkAdVYGmY5KnDJKKErZWUh/3 h58os9UyRXyrP576jiUH9Y/UARgmcJCwXPt9vemocEfRdfF0yn+/KWkrDNMGR/equlOu I5TQ== X-Gm-Message-State: AOAM53217l8pcDmcofc0NHR0XDHvh2/RMT0fpJTuTFR4AzWSH2nwoe6a 8fmLJASUbAN55XcvtSNQ0J+AhA== X-Google-Smtp-Source: ABdhPJw0GfkD58V7wLXogFVILFibqvC5VFzXghPsaXm5XyylB2lp8bqC4dHhc8+T+jRY5a0/FKsztg== X-Received: by 2002:a05:6e02:c89:b0:2cf:db51:f69b with SMTP id b9-20020a056e020c8900b002cfdb51f69bmr10111842ile.263.1653531954967; Wed, 25 May 2022 19:25:54 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id ca27-20020a0566381c1b00b0032b3a78175fsm124014jab.35.2022.05.25.19.25.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 May 2022 19:25:54 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 7A5848008F8; Wed, 25 May 2022 21:25:53 -0500 (CDT) Date: Wed, 25 May 2022 21:25:53 -0500 From: Justin Pryzby To: Kyotaro Horiguchi Cc: michael@paquier.xyz, andres@anarazel.de, nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: fix stats_fetch_consistency value in postgresql.conf.sample Message-ID: <20220526022553.GV19626@telsasoft.com> References: <20220525.155623.1140106707572944089.horikyota.ntt@gmail.com> <20220525.161207.1389849691748709887.horikyota.ntt@gmail.com> <20220526.111018.1043498429473068058.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220526.111018.1043498429473068058.horikyota.ntt@gmail.com> 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 Thu, May 26, 2022 at 11:10:18AM +0900, Kyotaro Horiguchi wrote: > Yeah, "boot_val" is appropreate here. And I noticed that pg_settings > has the "unit" field. I'll try using them. I wrote this in guc.sql, which seems promising, but it needs to be rewritten in check_guc.pl to access postgresql.conf from the source tree. Do you want to handle that ? +\getenv abs_srcdir PG_ABS_SRCDIR +\set filename :abs_srcdir '../../../../src/backend/utils/misc/postgresql.conf.sample' + +begin; +CREATE TEMP TABLE sample_conf AS +-- SELECT m[1] AS name, trim(BOTH '''' FROM m[3]) AS sample_value +SELECT m[1] AS name, COALESCE(m[3], m[5]) AS sample_value +FROM (SELECT regexp_split_to_table(pg_read_file(:'filename'), '\n') AS ln) conf, +-- regexp_match(ln, '^#?([_[:alpha:]]+) (= ([^[:space:]]*)|[^ ]*$).*') AS m +regexp_match(ln, '^#?([_[:alpha:]]+) (= ''([^'']*)''|(= ([^[:space:]]*))|[^ ]*$).*') AS m +WHERE ln ~ '^#?[[:alpha:]]'; + +-- test that GUCs in postgresql.conf have correct default values +SELECT name, tsf.cooked_value, sc.sample_value +FROM tab_settings_flags tsf JOIN sample_conf sc USING(name) +WHERE NOT not_in_sample AND tsf.cooked_value != sc.sample_value AND tsf.cooked_value||'.0' != sc.sample_value +ORDER BY 1; +rollback; It detects the original problem: stats_fetch_consistency | cache | none And I think these should be updated it postgresql.conf to use the same unit as in current_setting(). track_activity_query_size | 1kB | 1024 wal_buffers | 4MB | -1 wal_receiver_timeout | 1min | 60s wal_sender_timeout | 1min | 60s -- Justin