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 1oEy6t-0001v3-Ht for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jul 2022 19:14:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEy6s-0006b6-Al for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jul 2022 19:14:50 +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 1oEy6s-0006ax-13 for pgsql-hackers@lists.postgresql.org; Fri, 22 Jul 2022 19:14:50 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEy6p-0004F2-Lf for pgsql-hackers@lists.postgresql.org; Fri, 22 Jul 2022 19:14:49 +0000 Received: by mail-qt1-x82b.google.com with SMTP id c20so4201780qtw.8 for ; Fri, 22 Jul 2022 12:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc; bh=VDPbztsQ2Yd0cuWv8Bm3IfQjjx53OF03LXBfD2R4ke8=; b=V+YVRc74QiPIuOHf/VQcjKeT3yz4tqBoPlJYoWgsQEPWWsi3HEXCy023ZB8i7ZVThG dixzptR1qcfeSH9IovEV74XCtvyWvfg62fBhDl3PpO1zmAxlbtPDFF4jVJEvfIZVOTfy h0QD5Fat62lP6BrmUuQVMQTlH9ETorm4uFMY2JiQUkT+WBNPEWncXDrHL+MgA/5jJtcy 6iiTrt1bUK/UQ4oovecYMDXOCpHiP0/hUB5oLV1p3eOFFrlwa05ro29a/t0R/0HQ+a3+ EKf2/PBU5vnOfjNrjuRF5I8pnyFRbt6UTIPpWZsMqLxEqA16KvCDIZ63hDPjwIRgEQ5Q ZtuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=VDPbztsQ2Yd0cuWv8Bm3IfQjjx53OF03LXBfD2R4ke8=; b=TtdPKCoAJbBEVjwtgIcEWSVqmaqRtoGQ0dTPeAymChpeBeZ/ddCO3XmnOKwkn8otS+ wECzVnJ4xtFulHAOPXxspaDFn+7Q1pbd8lgHxdr5oFMwWh4/RWCQnyUKZJxBAPXpJTk+ hancz3pM1OBXsPpToMYhraSTWHZLpgHwxtc3kAdWVdGYFI4YJ/ZYEIBJmO8FOKoAO++H HIpNUdzlD4sIGuQoO3kDbi1jQMEzciPTLGoh4tJSC8iy7Q1G8Jz2CAd4zECA1HvONzYD t+SfTIsk+u/l7EEFhLVfieGJRx5YPIjV7ERZszrVMgQKjZmVzXKEl9LdZnEzvOBN6f0e HRag== X-Gm-Message-State: AJIora/1kdZtTvIuGqDMoq3dVwg70dTrSJ0WSLu+yqP4Ti+kRvS5r2tI 6tuyJQnNl7GuASVezZeweA/WCg== X-Google-Smtp-Source: AGRyM1vQntvKh9SHruCglaaVKsiIf2zQFUNPs41Ua3CP/1kWkFoTPC6Qyzu8L+iAwhP/MyKXArPinw== X-Received: by 2002:ac8:58c2:0:b0:31f:8a2:1bb2 with SMTP id u2-20020ac858c2000000b0031f08a21bb2mr1400973qta.121.1658517285482; Fri, 22 Jul 2022 12:14:45 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x9-20020a05620a448900b006b614fe291bsm4416960qkp.28.2022.07.22.12.14.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2022 12:14:44 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 98BD0803B17; Fri, 22 Jul 2022 14:14:43 -0500 (CDT) Date: Fri, 22 Jul 2022 14:14:43 -0500 From: Justin Pryzby To: Tom Lane Cc: Maciek Sakrejda , Robert Haas , "David G. Johnston" , Bharath Rupireddy , pgsql-hackers@lists.postgresql.org Subject: Re: warn if GUC set to an invalid shared library Message-ID: <20220722191443.GE7789@telsasoft.com> References: <164378196169.19783.12147751717180735532.pgcf@coridan.postgresql.org> <20220210015854.GV31460@telsasoft.com> <20220722015412.GA7789@telsasoft.com> <675610.1658512401@sss.pgh.pa.us> <20220722183557.GC7789@telsasoft.com> <729940.1658516423@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <729940.1658516423@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, Jul 22, 2022 at 03:00:23PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Fri, Jul 22, 2022 at 01:53:21PM -0400, Tom Lane wrote: > >> This indicates that the warning is being issued in the wrong place. > >> It's okay if it comes out during ALTER SYSTEM. It's not okay if it > >> comes out during server start; then it's just an annoyance. > > > The previous patch version checked if (!IsUnderPostmaster()) before warning. > > Is there a better way ? > > > ALTER SYSTEM uses PGC_S_FILE, the same as during startup.. > > Shouldn't you be doing this when the source is PGC_S_TEST, instead? > That's pretty much what it's for. See check_default_table_access_method > and other examples. That makes sense, but it doesn't work for ALTER SYSTEM, which uses PGC_S_FILE. postgres=# ALTER SYSTEM SET shared_preload_libraries =a; 2022-07-22 14:07:25.489 CDT client backend[23623] psql WARNING: source 3 WARNING: source 3 2022-07-22 14:07:25.489 CDT client backend[23623] psql WARNING: could not access file "$libdir/plugins/a" 2022-07-22 14:07:25.489 CDT client backend[23623] psql DETAIL: The server will currently fail to start with this setting. 2022-07-22 14:07:25.489 CDT client backend[23623] psql HINT: If the server is shut down, it will be necessary to manually edit the postgresql.auto.conf file to allow it to start again. postgres=# ALTER SYSTEM SET default_table_access_method=abc; Breakpoint 1, check_default_table_access_method (newval=0x7ffe4c6fe820, extra=0x7ffe4c6fe828, source=PGC_S_FILE) at tableamapi.c:112 -- Justin