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 1pVZqo-0001Y4-JP for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Feb 2023 15:19:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVZqn-0005Q8-AM for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Feb 2023 15:19:09 +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 1pVZqn-0005Pz-10 for pgsql-hackers@lists.postgresql.org; Fri, 24 Feb 2023 15:19:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVZqj-0003Jr-R5 for pgsql-hackers@lists.postgresql.org; Fri, 24 Feb 2023 15:19:08 +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 31OFJ4xp837373; Fri, 24 Feb 2023 10:19:04 -0500 From: Tom Lane To: Daniel Gustafsson cc: Postgres hackers Subject: Re: Stale references to guc.c in comments/tests In-reply-to: <6B50C70C-8C1F-4F9A-A7C0-EEAFCC032406@yesql.se> References: <6B50C70C-8C1F-4F9A-A7C0-EEAFCC032406@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Fri, 24 Feb 2023 14:15:55 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <837371.1677251944.1@sss.pgh.pa.us> Date: Fri, 24 Feb 2023 10:19:04 -0500 Message-ID: <837372.1677251944@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > I happened to notice that there were a few references to guc.c regarding > variables, which with the recent refactoring in 0a20ff54f have become stale. > Attached is a trivial patch to instead point to guc_tables.c. Hmm, I think you may have done an overenthusiastic replacement here. I agree with changes like this: -extern char *role_string; /* in guc.c */ +extern char *role_string; /* in guc_tables.c */ because clearly that variable is now declared in guc_tables.c and guc.c knows nothing of it explicitly. However, a lot of these places are really talking about the behavior of the GUC mechanisms as a whole, and so a pointer to guc_tables.c doesn't seem very on-point to me --- I find it hard to attribute behavior to a static table. Here for instance: @@ -3041,7 +3041,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS) * * Variables that are not so marked should just be emitted as * simple string literals. If the variable is not known to - * guc.c, we'll do that; this makes it unsafe to use + * guc_tables.c, we'll do that; this makes it unsafe to use * GUC_LIST_QUOTE for extension variables. */ if (GetConfigOptionFlags(configitem, true) & GUC_LIST_QUOTE) An extension's GUC is by definition not known in guc_tables.c, so I think this change is losing the point of the text. What it's really describing is a variable that hasn't been entered into the dynamic tables maintained by guc.c. Perhaps you could use "the GUC mechanisms" in these places, but it's a bit longer than "guc.c". Leaving such references alone seems OK too. regards, tom lane