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 1peoS8-0003I4-4W for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Mar 2023 02:43:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1peoS6-0008EB-3l for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Mar 2023 02:43:50 +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 1peoS5-0008E1-Px for pgsql-hackers@lists.postgresql.org; Wed, 22 Mar 2023 02:43:49 +0000 Received: from mail-ua1-f50.google.com ([209.85.222.50]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1peoRy-0005IO-LK for pgsql-hackers@lists.postgresql.org; Wed, 22 Mar 2023 02:43:48 +0000 Received: by mail-ua1-f50.google.com with SMTP id 89so11726420uao.0 for ; Tue, 21 Mar 2023 19:43:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679453021; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7CrjowW0EPMTBvdWX91zoFr9WelpUniqOU/h/AKYDvk=; b=TfYbd8+ELcdWTjeu1JmUas4Uu3/3HYpGjgQdgamfBj4XdIOqPl083/2qfBuGH+uL7+ bpfJVNDPL3m0nqvo4xzS+hUjFQn5L2/TdhNdY+pqnfRplpJob+fjPlbqmFkcmPazCIIh IkyiIsS4jtQ2rXKqJtNVsFOyCxWRpg8QOzVrEogB9pSznoVHS+jv30GY5fDjXRuYPxcB TueJYMhprN3jJavpfc3e233xb9drrCFjKQ1UuGn6E/oSRQQk9HtyR6qeAWHEd7M3pTWK N1g64pHBoX1+QmE1GMdusVi96NXz6szZptxuCPiDjwrEQUAEhDNxQifozFK/tkfoGUAL 6w9A== X-Gm-Message-State: AO0yUKUfBIKNEQHJMQKWTz1HPghSc2cNxS1ist1Ppe86j+rUj3Qwbjg2 7H6zpm2BYPn5a1muj67aH3QhHgh2uDy/6yH09/OHV1ON3R0= X-Google-Smtp-Source: AK7set/8mRBqIb+88Gdko8xw5LiN/dj1emTq8asUqKzBkZDd7ZxyKujiJ7buZeDmlTbE52UHwbdgK7aSYQQS2MZ/Brk= X-Received: by 2002:ac5:c74f:0:b0:401:d1f4:bccf with SMTP id b15-20020ac5c74f000000b00401d1f4bccfmr633717vkn.0.1679453021288; Tue, 21 Mar 2023 19:43:41 -0700 (PDT) MIME-Version: 1.0 From: Greg Stark Date: Tue, 21 Mar 2023 22:43:05 -0400 Message-ID: Subject: misplaced GUC in pqcomm.h -- where to put actual common variable though...? To: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk So back in 2002 in 7.3 there was a commit 2c6b34d9598 which added a GUC db_user_namespace which is stored in a variable Db_user_namespace. All that seems fine except... The variable this GUC is stored in is Db_user_namespace which... is actually declared in pqcomm.h which is intended to be "Definitions common to frontends and backends". Afaics it's never actually defined in any FE code, neither libpq nor any clients. I was a bit surprised this isn't producing a warning about an extern declaration that's never defined but I guess that's not actually that unusual. The actual variable is defined in the backend in postmaster.c. I'm guessing this declaration can just move to libpq/libpq.h which (counterintuitively) is for the backend iiuc. I don't think this causes any actual problems aside from namespace pollution but it confused me. I found this because I was looking for where to put the ALPN protocol version which (at least at the moment) would be the same for the server and client. But as far as I can tell it would be the only variable (other than the above) declared in both and that means there's no particularly handy place to put the definition. -- greg