Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tp6S1-000W99-NU for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 14:07:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tp6S0-008H1c-4q for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Mar 2025 14:07:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tp6Rz-008Gy4-Qb for pgsql-hackers@lists.postgresql.org; Mon, 03 Mar 2025 14:07:19 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tp6Rx-000itN-2g for pgsql-hackers@postgresql.org; Mon, 03 Mar 2025 14:07:18 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43bc38bb6baso5479535e9.3 for ; Mon, 03 Mar 2025 06:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741010836; x=1741615636; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9UM+Ilo1vJxWyWNFUgatsOTpS4GcpbVIy+Amz4vJ9ew=; b=gSn6Ger0gdHYv47zZWEHSKj7YD649tT3xBPoB3kqEqHxgjIZMfHeBUC2UPQwFsZ22g G6LJvThkhhQkTu2By40Elf/46+i5MAUaxAES2yeg+b/mz0LnY2aWk9sCSYzhL5LLITHC W5iEWzCjfWEnsgOdgQ4RgEMUO+quHlk0/ov4NkW3dFLxa0XMQ3gVHZUJR2rj2TcyeHJF dDsTHY1R9Pem1GYsEeFa6V9pbJWcqek8UPfj7EsC3FMuEgcsfrUT6n5bG16ix2oG839x 2M/VJ5uoGeG/2URMU9qwDEpZumfaIUd2+zJFmwRa1IA7K7jo5kuZB8OrlQn2v33u3RSu JYXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741010836; x=1741615636; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9UM+Ilo1vJxWyWNFUgatsOTpS4GcpbVIy+Amz4vJ9ew=; b=hBQ63PeA9GasQeKv3MrmgWokw7MVn4euytHPjqQfz8eHJkiM0uZza4o2pjl3kkb+1G bdhuOUChypFFCsfn3y7sntTo7d8XDubC7CXdqU+brnuHoQizy5F2a51PRyIYxBzuY/rO RPGW7cp4+n0GoVKZI4Gd9Q0SPVmo8d56CB7VSBNrIN04F9omsJfwQG/A6wEftbNJSunn 2S4NG29G0JysuS73/5ifQFm8Um/wnLwNZ2+iBltKfU3/Os3tmCGT0znR5atG6M9dAGIG IAkoQj9MKJFkfvHTsX2jQyHXe1hBdRMd/BUB7ibZrzlY0qt1pmNr0Z5oxltZPzU40ncS cKRA== X-Forwarded-Encrypted: i=1; AJvYcCUn89J0UCyKYWgeOG/H0xXHNDF49dKzjhY3hmEO1eB5BZGhZBB7bbao4fAwPv9Y7a77XYI7UgY4ne76Nu/b@postgresql.org X-Gm-Message-State: AOJu0YzildqqtxQYT3N4lrhjRmrUCBAyJXl+tGLMv2nbZcb2cmRBLVgB QuMvK3qLH7WC032sCpoiOYBj4Hu3LWtR83U0vKt33QGblA5F6mWj X-Gm-Gg: ASbGncsYStuecA2VXUcwd6+5+RU+qnESEwky9GCOg66kTUiOc1rWhQ88jNaBxkz/Bya +Tn/my8CEucCzFEwSPrVEPqfoDBtiDxzWZBrF5mwC9k3oFZnQCbpJBBv2vy9apuevBj+0qIEgK9 qERj5jTPMqwlfIfIlvPJl3iLaoBq/nmbUKJzQal0m+GKoFkrj1XjeMENkjUPNvYAnym14EC7tpF KpQSLqfawENPy4Cwqs7vbsRpvfh/D/rPuLFSMQj9brjAI2MtChRQfwjVpoRStWTArL4cw5Ze/OB E4KnweDU1aI6TRN0EC6kEK1EPKV9ySo1o7Dm5DRaa34rGHAmmWTClOGet7dyKzoJbr0RMrud9eg I6BTo1YYNgptmcK+ZIPE9d+RA6up+Un+BI1r7kEsjuP8cvfvE+mC5WLrP08nD3pqoHLdztdouvr jd X-Google-Smtp-Source: AGHT+IHEFkJyN5P/DR/uGh1LsRrH3/2TfiVUSTniNRL/nghhJwv+NLs4sqavdRq+FDRZgBlAfoDl+g== X-Received: by 2002:a05:600c:5014:b0:439:9a40:aa09 with SMTP id 5b1f17b1804b1-43ba730d731mr93800035e9.25.1741010833801; Mon, 03 Mar 2025 06:07:13 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43b736f74e8sm167900495e9.7.2025.03.03.06.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 06:07:13 -0800 (PST) Date: Mon, 3 Mar 2025 14:07:12 +0000 From: Bertrand Drouvot To: Melanie Plageman Cc: Fujii Masao , Guillaume Lelarge , Pg Hackers , Daniel Gustafsson , andrey.chudnovskiy@microsoft.com, Jelte Fennema-Nio , Jacob Champion Subject: Re: Log connection establishment timings Message-ID: References: <65fe2d68-a214-40f0-80a8-56ca7323ad5c@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Feb 28, 2025 at 05:42:37PM -0500, Melanie Plageman wrote: > And all of these places we have to be super > careful that the GUCs have already been read before using > log_connections, so it seems a bit unsafe to check log_connections > (the global variable) in a function. Yeah, that could be checking before calling the function (the caller would be responsible for checking log_connections) > Also, I also wasn't sure if it would be weird to call a function like > "LogConnectionTiming()" which in many cases doesn't log the connection > timing (because it is a different backend type). > > But maybe I'm not thinking about it correctly. What were you imagining? I did not imagine that much ;-) I was just seeing this code being duplicated and just thought about to avoid the duplication. But now that I read your comments above then I think we could just macro-ize the child_type check (as you mentioned up-thread). That would avoid the risk to forget to update the 3 locations doing the exact same check should we add a new child type in the game. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com