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.96) (envelope-from ) id 1w2263-000opF-0d for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 07:10:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2261-00824C-39 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 07:10:38 +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.96) (envelope-from ) id 1w2261-008244-1n for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 07:10:38 +0000 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w225x-00000000MMe-13pg for pgsql-hackers@postgresql.org; Mon, 16 Mar 2026 07:10:37 +0000 Received: from mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:3a87:0:640:845c:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 0BC1CC01AE; Mon, 16 Mar 2026 10:10:29 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:803e:400:e52b:7350:1093:4a4b]) by mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QAFdkF1AheA0-cCNKi62w; Mon, 16 Mar 2026 10:10:28 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1773645028; bh=nmII/74BMJJebQ/mTaqpa+tEJCei4/b5hH+kTwpfHh8=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=SW64x0i6eeKqIz+nH9NYTsdBOJcTsEcSU8tqyg9nDILqwvV+qfFFG+rco4PdWRwgb qu7v53El0QGbhfihuOoOInx3+pkXtMntRjoJ5dXPKd/+EUUeaCXlje/CwqVt16IhVb ZsXdVT3uWEkfV2Ht4ghav+bfm1fWmEin0sn9WFgA= Authentication-Results: mail-nwsmtp-smtp-corp-main-69.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.300.41.1.7\)) Subject: Re: Improve OAuth discovery logging From: Andrey Borodin In-Reply-To: Date: Mon, 16 Mar 2026 12:10:16 +0500 Cc: Jacob Champion , Chao Li , Daniel Gustafsson , PostgreSQL Hackers , Michael Paquier , Tom Lane Content-Transfer-Encoding: 7bit Message-Id: <99C6E80B-8770-41C2-8084-BF3C7F389FFF@yandex-team.ru> References: <7DB528BA-C7A0-4B23-890C-5332FB35A16E@yesql.se> <7094F798-8DD1-4974-9A04-10E147B29581@gmail.com> <15434512-B3FB-4AB3-B6B3-5D85ED0B4BBE@yandex-team.ru> To: Zsolt Parragi X-Mailer: Apple Mail (2.3864.300.41.1.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 16 Mar 2026, at 11:24, Zsolt Parragi wrote: > >> I'm experimenting with an ereport(FATAL_CLIENT_ONLY) option, in the >> same vein as WARNING_CLIENT_ONLY, to try to cover this. > > I attached v7 that uses that and removes the abandoned handling as it > is no longer needed with it. > >> P.S. I would eventually like to record our undocumented SASL profile >> in a test suite (he said, staring at pg-pytest)... > > That would be definitely useful, with the todo comment and this not > being documented I thought that this is a proper way to handle the > issue. Even a proper documentation about it would be a good starting > point. > I've took a look into v7. FATAL_CLIENT_ONLY approach LGTM. pg_stat_database.sessions_fatal seems to be still incremented, but, probably, we can live with it. But also we can fix it. Changes to send_message_to_server_log() seems unreachable to me. I think is_log_level_output() returns false for FATAL_CLIENT_ONLY, so edata->output_to_server is never set to true for this level, and these functions are never called. FATAL_CLIENT_ONLY = 23 sits between FATAL (22) and PANIC (24). Consider swapping FATAL and FATAL_CLIENT_ONLY, so that code like this will have more sense: elevel = Max(elevel, errordata[i].elevel); Does this assignment have an effect? + ctx->state = OAUTH_STATE_FINISHED; + ereport(FATAL_CLIENT_ONLY, Thanks! Best regards, Andrey Borodin.