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 1oUF62-0006aI-GB for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2022 22:25:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oUF60-0000iO-MW for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Sep 2022 22:25:04 +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 1oUF60-0000iE-AS for pgsql-hackers@lists.postgresql.org; Fri, 02 Sep 2022 22:25:04 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oUF5w-0007Gw-Rt for pgsql-hackers@lists.postgresql.org; Fri, 02 Sep 2022 22:25:02 +0000 Received: by mail-io1-xd29.google.com with SMTP id e195so2814061iof.1 for ; Fri, 02 Sep 2022 15:25:00 -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:subject:date; bh=b18snNwXygVcqRtzF/fqpRN29tq9D9KRQMPQ1UVyGa4=; b=BMEYtXFoY7y1KI1MeN97wtbR0vTj5S2j7xwaa0jfN8ihlanPmhS2CqwlmxAWk9Se1y RMfKIBKz3OtRbw5iollr8qHKuTGxTmJ1KP6X3jFUmZiDy1JwyUgqnj2UR8T6qRu/0q/Y YieNtUPKMyB3ADxy6GvN8d+lk8o7cI1lrHwoczsOZcSFnovufn/ZY8CHDO5i3lJn04q3 b7wOy8T+EWRt+FOaHmheMj3wYG9wLRGpbCCjBPy90NgzCfbSf9M7bm7m+IniWWhx72R7 ry6d8Ozo8Y9AD1mRR4JjoRXt9ufQCXH9DNdaCni/ZTi5qZ1/14deyaVxGTGNY3VuyR1f Q8GA== 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 :subject:date; bh=b18snNwXygVcqRtzF/fqpRN29tq9D9KRQMPQ1UVyGa4=; b=09ijcJFt0hIi7/CNZBbiIYJOh//LUb+UkAfK3wn3lDQNzN5v220R+wU3LzDNBWR6j4 IFEGF6UCSq3ttGTkODi86wEkFi3Sdo5mPWjbq6LX3ueA5MIAcG+icjAEbn3bZvHdax5T sqoLuH0inHUAf0SqSZMEqcPVe3rFVMdxBgET2ZVhqUZOd6wqAVXZYPXvHao1wT3pNFwN VhKc3+7pISs8yzTIN86xuxm2m/8ZLOF2YOuzjph+VrwG7v6xod5KXJX6nfRFL8ZNGBPa OjZSdc4MDsf0x8s8QaQmiQJgK56CipWcpihw8jLRX4CWyoIHgjNPoV2eXJrD6aqm6ngY GUAw== X-Gm-Message-State: ACgBeo01QNKjYtGvLIXXZbdhhXW3Cy1hKqa1DRr214nhj+lq161K+8GB ZtYEoycWzmAK+X+jkQwLxYu+sw== X-Google-Smtp-Source: AA6agR5XMoCveQ9Wdr1d7xT2YOZWA/1kVTE23wIKg39Cf0jAU343hXL9byOZvAn6gfDzyBxd/2HOHw== X-Received: by 2002:a05:6602:2c01:b0:68b:559f:bbef with SMTP id w1-20020a0566022c0100b0068b559fbbefmr12780435iov.204.1662157499952; Fri, 02 Sep 2022 15:24:59 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id v5-20020a056e0213c500b002eaddcf4c75sm1253927ilj.47.2022.09.02.15.24.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2022 15:24:59 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 3AF92800E22; Fri, 2 Sep 2022 17:24:58 -0500 (CDT) Date: Fri, 2 Sep 2022 17:24:58 -0500 From: Justin Pryzby To: Tom Lane Cc: Maciek Sakrejda , Robert Haas , "David G. Johnston" , Bharath Rupireddy , Cary Huang , pgsql-hackers@lists.postgresql.org Subject: Re: warn if GUC set to an invalid shared library Message-ID: <20220902222458.GC31833@telsasoft.com> References: <20220210015854.GV31460@telsasoft.com> <20220722015412.GA7789@telsasoft.com> <675610.1658512401@sss.pgh.pa.us> <20220722183557.GC7789@telsasoft.com> <729940.1658516423@sss.pgh.pa.us> <20220722191443.GE7789@telsasoft.com> <734432.1658518007@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <734432.1658518007@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:26:47PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Fri, Jul 22, 2022 at 03:00:23PM -0400, Tom Lane wrote: > >> Shouldn't you be doing this when the source is PGC_S_TEST, instead? > > > That makes sense, but it doesn't work for ALTER SYSTEM, which uses PGC_S_FILE. > > Hmph. I wonder if we shouldn't change that, because it's a lie. I think so, and I was going to raise this question some months ago when I first picked up the patch. The question is, which behavior do we want ? postgres=# ALTER SYSTEM SET default_table_access_method=abc; 2022-07-22 15:24:55.445 CDT client backend[27938] psql ERROR: invalid value for parameter "default_table_access_method": "abc" 2022-07-22 15:24:55.445 CDT client backend[27938] psql DETAIL: Table access method "abc" does not exist. 2022-07-22 15:24:55.445 CDT client backend[27938] psql STATEMENT: ALTER SYSTEM SET default_table_access_method=abc; That behavior differs from ALTER SYSTEM SET shared_preload_libraries, which supports first seting the GUC and then installing the library. If that wasn't supported, I think we'd just throw an error and avoid the possibility that the server can't start. It caused no issue when I changed: /* Check that it's acceptable for the indicated parameter */ if (!parse_and_validate_value(record, name, value, - PGC_S_FILE, ERROR, + PGC_S_TEST, ERROR, &newval, &newextra)) I'm not sure where to go from here. -- Justin