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 1wRnuN-002iJE-0w for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 09:17:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRnuK-00456O-1L for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 09:17:05 +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 1wRnuK-00456F-0M for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 09:17:05 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRnuI-00000000peI-22ot for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 09:17:03 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7e5fd39cf11so3673229a34.0 for ; Tue, 26 May 2026 02:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779787022; cv=none; d=google.com; s=arc-20240605; b=d4RD50Q1Cn7kIRXoUWsJrkw0C7SZ11rpKUNi9wbc9/KLdz02cjVGwOCKgoxD6f5O2T GgGvqYSNoCN3NbyZpi50/Z23C/CdbVtbbv4bFWVXmU+a4TKlwMWgqtSAz7sDlsyjfDU9 cf9rKeceyJHPkoWsKG6NfHOr6+8bUFeFRZa9h8B3g+vk1Imxx1P5qFcHqib8eEoaO5k4 8RNnZQVaiwyktzCxzqIv5EpVP7KV0lfUqO6CzPGlQrxcvS2mOhiQW2vU5ZCYE/S3dnKb UgIZ6+8oWMLQ0oX9e42ID5XKgE3MAUFbnwiA309GwEYX5gSa91zjvySlzvZ2sLNRflY/ LL5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Hmwla02nQ8BJnO5zpA/FDC1IBKFb6TiXLiuPOtx2hak=; fh=bZ7fTT0o6iX9+vhlwRgMGqVU72vZGSRYQ8nwMSIcjF0=; b=VmcdoTQzBkTi7ie/5ZTqNdfujpCrJfCVVdkvHi0ZkX7PX4u9PphHAB4v5OSIeWZO/A vLzZ9fWOzczdMUaKAFAg9ILiHnn908nV+GAQCTzSW9uQnjfrVC4Od/mxdtUDPthiSnWR oTfJmmvP0IRcugLsKTthYeI/44K1k9hqNYK3iwB8W0tSCly2HUJGann0xEbb5ay+BEPB phXji5Xx/DtemCywOQiCB5l/9sGZ508Hn/ARWaXSuHf6q6uHoQ/8VhtuAOnRP7VnETdf r+EPNUlv7QHmT9belk+VJOMVm21aDO57qSui/WENkkzcFDi6DHWz/aHKZk07hvmdl724 FBbg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tigerdata.com; s=google; t=1779787022; x=1780391822; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hmwla02nQ8BJnO5zpA/FDC1IBKFb6TiXLiuPOtx2hak=; b=bQoJOngGX5B2BBFI9YSJw8mN3tZucMQnaRrdNPrMzRf60RMFjC4qR/cLI9ORep/CEs 0dYrn4N1kR3ARf5W/23n/ceznm+UEQCNq0OIF+wlH/d1hiXf69oQnyyQ5cdFiNf1KZL2 51Fm1dMTCObxgYz7/RG9taR0f+hOMlgAN1sFDeN/AMA2uM9Z8stSvopt8YylXVQzQh7U her+/JCCyojrXtCmIgvHOhXxhbw6Mg5iLkVfNNKPsAA8oqXtUkxqpTkI5YqNE6S0PGuL vblLFhdJzdiYvCo9lgEfV5u2VZRk63Dpo+3YLC7xdH9NygzSSZvQ7zM8G8I9MiFiXIEL cqWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779787022; x=1780391822; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Hmwla02nQ8BJnO5zpA/FDC1IBKFb6TiXLiuPOtx2hak=; b=VNDQD5uQ+v84fFP+/SgSWbJO+TNhFmeh2V8RsRXEEayTJmjIv+IAkyolql3smPdRcL B5lCSzVL4BgeBunEzl1RrXLDshPNpM72Ny3HFRWbAI8OYDvyVtMvv6Ue0G5Slkw+mMTv /RCkHk/KIR6kb3+7OWHqPadW/VEe3TsulaMdSyxfq+MhK3Vdu6gytA7mWcyIEh/J2s4N BN23aaLk5A6kDlX4Jgr3z752IVoAyXxxzVwOIaIwKe2s+34Q8j74S4+FkoK+Wsztp1ww TzLG+FevN7LaBz5kYlFuxUtJaZ4KSGOLPUXjz2Qu2iFwtqZZNE5u3LgAIpLQX7oQk7u9 VZ3A== X-Gm-Message-State: AOJu0YyJpe96wMYTx72eyOhg5AEPysGFKBAWS7RJ7kq/A8MtIUDiTei9 YsPO1ieA6bK2JnKgpuaKCVUAWPSzybq3YVMYz+F8QyIA36svfIirwGoRIIil2B/JP0LbudKUqxe FJ0AowpSOba3LvoDj0otOfI2z2uVKNODegm0xlaiilivrSgiBkmqyAVcB3A== X-Gm-Gg: Acq92OEkwo04bMbowaV0Cd8xIDQk4WkRWC95M+dUnXAihp9C9PoPRwsHDEfS9mcSCFH m4GKLT9aGhh5U9c1DUuHpkItMqlNUQOM+bOe5n9qmAxVEN71BQwl7icW1vgcyC+23rwK8NcMOqf 9tCCIj822k+FzODC7hWxFG3RN9fEmrgFIpYxaoDj257ZLj46FZ9xVHIDBeHz+lowSW0BZuE/Pq0 z+HJjtVVAS6ZIbPl4bX5tURNCKEh8k4F6QWBrweMljA/1YzNLNNP1b0Ca2CxEB3NZ4MhFF6BZi+ BdLxMLq+EqojczgYlgDrNlnKkOnz2aM21QWdBOm61pDgYv8DJRPhj4yBdMq0pb5e7DNG90U= X-Received: by 2002:a05:6830:81ca:b0:7de:649d:f2ab with SMTP id 46e09a7af769-7e5fedd6094mr11458075a34.13.1779787021807; Tue, 26 May 2026 02:17:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aleksander Alekseev Date: Tue, 26 May 2026 12:16:50 +0300 X-Gm-Features: AVHnY4Lr3lSw1tU-_3Z3skw1dVl-apJnjpzsbx7kk310Twuzf4ox_RTBZSa2zhc Message-ID: Subject: Re: [PATCH] Little refactoring of portalcmds.c To: pgsql-hackers Cc: Zizhuan Liu <44973863@qq.com>, quanzongliang , qiuwenhuifx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, > I have reviewed patch 6113 on CommitFest. > CommitFest page: https://commitfest.postgresql.org/patch/6113/ > > The newly introduced check_cursor_name() implements the logic to reject e= mpty cursor names, which matches the existing checks in PerformCursorOpen()= and PerformPortalFetch(). > > However, this helper function is not a good fit for PerformPortalClose().= At the start of this function, there is a check for name =3D=3D NULL =E2= =80=94 a NULL name corresponds to the CLOSE ALL command =E2=80=94 and this = check runs prior to validating whether the name is an empty string. > > While calling check_cursor_name() inside PerformPortalClose() would keep = the current behavior intact, it could confuse future readers. This approach= also fails to achieve truly consistent cursor name validation across all t= hree functions, and may add extra maintenance burdens in the long term. > > On the other hand, if we only refactor PerformCursorOpen() and PerformPor= talFetch(), the change would end up being rather minimal. > > Considering all these factors, I'd suggest leaving the code as it is. > > (Sorry, I tried but still cannot post this to the original thread.) No problem, in fact from what I can tell you did everything right. OK, let's withdraw the patch. Thanks for reviewing! --=20 Best regards, Aleksander Alekseev