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 1uyFkD-005fGR-I8 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 20:24:13 +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 1uyFkB-00DZ98-Cx for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 20:24:12 +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 1uyFkA-00DZ8z-Jg for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 20:24:11 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uyFk9-000bDH-0G for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 20:24:10 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 253971D0018C; Mon, 15 Sep 2025 16:24:08 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 15 Sep 2025 16:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1757967847; x= 1758054247; bh=hFwJhr4fEL+UxjEfDzzUdo/tkhuLC8I0jnuZvruiYg8=; b=D 7BS7/eoZLsI6zPez9zUUd9yJP+rdn2YiKU2nW8+cw+B9PH/XWrBiNj97eZe5vNtw INV5Vka7OT0SI+sQxtnxdMxsgOAxJa8C34pNk7bamxAzJcOZTEXZFZitB+FC2t5W 3FXlZULHTxjyUgcGEOKRqchUSFH+98s4o3LX9sRxEqhKsJl1bwyB2HGxvF7F6IqU +GwbSfomUARKTuaVm6q/uiT8YPyaSqfJH5bxPdeYRMLcMXWzcUSNaQjkaXiZJUA8 XlksXCGsFFcWROU0Wo7REtsAYazt1kUd0c+of9cLluLqpkDUE3LqFaVDJ+zh4nz2 pP7KPfzISl3ISJoLp07eQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1757967847; x=1758054247; bh=h FwJhr4fEL+UxjEfDzzUdo/tkhuLC8I0jnuZvruiYg8=; b=iDB/1Hj12rpCd0oKk MB9DPU2ezfL2j+k6kGekyYN4sSh3EHPOz2WCgmUFsC4xRy/pIloz/oYW7n6Dl180 DS+iOPSx7D8D8LhB9BjGQQbQml98zaKVaykAVQr8zSZwh74gDd04qDJMi2NOBXP4 1K1uw0zu+gAAEcD5lShsiZ5S6gdMysgqseYJbqPI5zOBniGa+46Rn0NR58tNtMQB +F3M9Cpt3hHHD8noklkW0K+tN68IYbnlp3UmT97AkoX6I+v3pV2BDRvcG9KE3o16 ngYT7pJIfFCHhK9BwJF+YhZ81FTE7GFEDVIsiTwmeFWjwyeGYN+SqbS5iHHcbizu iC5bA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdefkeeigecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepteeuvdehffekvefgueehveetveekgfegtddtueefueehuddutdfhfeff hfejfeffnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprggvkhhorhhothhkohhvsehgmhgrihhlrdgtohhmpdhrtghpthht ohepgihunhgvnhhgiihhohhusehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlh dqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthht ohephidrshhokhholhhovhesphhoshhtghhrvghsphhrohdrrhhupdhrtghpthhtohepth homhgrshesvhhonhgurhgrrdhmvg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Sep 2025 16:24:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1757967845; bh=dfNzYjEmmx2mnWvAlrc3q+PJV5EWYW2/yb0QIJ54lrY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qF9sD6jmWAq4DLE4U5Y+QNQgqA4b9+VrOXsebnq9jIENiXTjJwuTfXBNOsMrx7A96 eFw8OlqLyY+6aV541OhnrulYOhzXnRj7lKFCmlqoJ+gEuzg+d0WNa4pZTkYD9T0OHO Kbrk0ts3ts+q0q7lA0hFKPvOvsBUfKya/6WbddOKtVvuI2OjedyLnGiHH8jUARgsyx 7/1K++SGutnqZdK9pfX092S12J832I0MHNwIHW84g7VbxaK3BMemb1/kruostcfnZc AXbkOk3F0CtdQw3V7m+WI9siZm0u7kqOGTDNv9iO5xYE2eEHY4gG37aqmdrdMBrW85 5gV0bkcPTu8Kw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 3A3F86D; Mon, 15 Sep 2025 22:24:05 +0200 (CEST) Date: Mon, 15 Sep 2025 22:24:05 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Alexander Korotkov Cc: Xuneng Zhou , Tomas Vondra , Yura Sokolov , pgsql-hackers@lists.postgresql.org Subject: Re: Implement waiting for wal lsn replay: reloaded Message-ID: <202509152003.m3wlpwa7i657@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Sep-15, Alexander Korotkov wrote: > > It's LGTM. The same pattern is observed in VACUUM, EXPLAIN, and CREATE > > PUBLICATION - all use minimal grammar rules that produce generic > > option lists, with the actual interpretation done in their respective > > implementation files. The moderate complexity in wait.c seems > > acceptable. Actually I find the code in ExecWaitStmt pretty unusual. We tend to use lists of DefElem (a name optionally followed by a value) instead of individual scattered elements that must later be matched up. Why not use utility_option_list instead and then loop on the list of DefElems? It'd be a lot simpler. Also, we've found that failing to surround the options by parens leads to pain down the road, so maybe add that. Given that the LSN seems to be mandatory, maybe make it something like WAIT FOR LSN 'xy/zzy' [ WITH ( utility_option_list ) ] This requires that you make LSN a keyword, albeit unreserved. Or you could make it WAIT FOR Ident [the rest] and then ensure in C that the identifier matches the word LSN, such as we do for "permissive" and "restrictive" in RowSecurityDefaultPermissive. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/