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 1v8xGj-007izj-7W for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Oct 2025 08:54:00 +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 1v8xGi-005Mi2-5h for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Oct 2025 08:53:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8xF5-005IpI-Eo for pgsql-hackers@lists.postgresql.org; Wed, 15 Oct 2025 08:52:18 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v8xEa-002I0e-1W for pgsql-hackers@lists.postgresql.org; Wed, 15 Oct 2025 08:52:18 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id D694914000BB; Wed, 15 Oct 2025 04:51:45 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 15 Oct 2025 04:51:45 -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=fm1; t=1760518305; x= 1760604705; bh=aII41n56d6NUnwXvHpksqUErT9+Uv5Tp4LK3YjG3fSE=; b=d V09Txn/bJrxtodvCNjoda7pZMtdN9oBYx0+Py7Y/j4k6ZHwBhEk3cT4khLexzipd agnD6m/PTfdM2+Uq89gSQnHNwQSogbOsSo56RMEGT5rlLZks/6Uu7AlhzKmF93dw VS72YWVl7qmvq9Ab0fzwUFONlnqYMEyn8fYFaxDWMWjZyDyQsnqZk9wFFcOZWARw DgXXRjg0HaVWS5joxKFya33ZtXPnJqTy4IRfWK29F1XtNbMCsN9+i1bgaOBPNtdi 7S5bCXZHCxknk6Vs8Un+TDzy824cBTUvRwiIOFAoBaL6mMs+Q335RBJp+Oze5qrm z38HNzszU1pMRSNNwExCQ== 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=fm2; t=1760518305; x=1760604705; bh=a II41n56d6NUnwXvHpksqUErT9+Uv5Tp4LK3YjG3fSE=; b=TnAhFZshu53KRUgp8 t9US1yOVfwedrHRna7xdU0onS3wzt4UCODZKAa1jXTfGs2qKqzohCkq9d0HmW44M eL55sSblXFdSf7Jbabxu0nM0yhZvwtPLUZe2kJRhlzn8O26dOY8qUynSERboP33M G+puXmZiE/TAlacFofdBTcIDGkLGAk7eJVuCp10bRy2Leeoempw2cFyXKFa+v5Fp UVxsr3bdDYhm7tRZpK6x74TJ+9hhgv/EBkTlydjYnTKH5D1tBNGcbZhOkN6Sh324 TEU5IklKMSS/c2HDfzZj8R47LoXT6SBLi0uC1RGNj3wu8j5NsJSZdnDD01Fz+8UD JpVaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduvddvleekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeekgfekhffggfehvdfgtddvvdeiheevudeitdeiheekudehgfetteev kedtfeekgeenucffohhmrghinhepphhoshhtghhrrdgvshdpvghnthgvrhhprhhishgvug gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeejpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopegrvghkohhrohhtkhhovhesghhmrghi lhdrtghomhdprhgtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrih hlrdgtohhmpdhrtghpthhtohepgihunhgvnhhgiihhohhusehgmhgrihhlrdgtohhmpdhr tghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqh hlrdhorhhgpdhrtghpthhtohepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgt phhtthhopeihrdhsohhkohhlohhvsehpohhsthhgrhgvshhprhhordhruhdprhgtphhtth hopehtohhmrghssehvohhnughrrgdrmhgv X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Oct 2025 04:51:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1760518302; bh=79SHeAJFwr7D6qMkGchpfuXk+0e3Bpl/MY9Fw0u9hyc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=pzViEQw0IOB7FaqDIGN35daxVfmpEPs0YdoLfVA2boeuB3q07XjRrILOm9twfurIl foNZMCNmBA48j6lj22VfDeUrg1aUcDW2RB1IZh3karyPfl26bLijDKLNGLEDiLqZwv uvhEwcNd5Z3lTvcwdQb5ohBzOv7r1Omq4zFkto00lnQzB+cl0JBORz2K5J0tLLvUBZ je7Ow5766MLYtfXtRSCdx4AsMBNmut77jroQE3cQnHiqQqDp0KeVF7+Y/aF1BUDM3L Wrc0TgQlHVKq3u02oY4BWcr6EYdG0AbC13/kBvYJFkLDOxYxSgfziBs40jz5+t1QpA XeXXACMAF+MhQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 9AA8576; Wed, 15 Oct 2025 10:51:42 +0200 (CEST) Date: Wed, 15 Oct 2025 10:51:42 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Xuneng Zhou Cc: Alexander Korotkov , Michael Paquier , jian he , Tomas Vondra , Yura Sokolov , pgsql-hackers@lists.postgresql.org Subject: Re: Implement waiting for wal lsn replay: reloaded Message-ID: <202510150831.g75i32rzddor@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 I didn't review the patch other than look at the grammar, but I disagree with using opt_with in it. I think WITH should be a mandatory word, or just not be there at all. The current formulation lets you do one of: 1. WAIT FOR LSN '123/456' WITH (opt = val); 2. WAIT FOR LSN '123/456' (opt = val); 3. WAIT FOR LSN '123/456'; and I don't see why you need two ways to specify an option list. So one option is to remove opt_wait_with_clause and just use opt_utility_option_list, which would remove the WITH keyword from there (ie. only keep 2 and 3 from the above list). But I think that's worse: just look at the REPACK grammar[1], where we have to have additional productions for the optional parenthesized option list. So why not do just +opt_wait_with_clause: + WITH '(' utility_option_list ')' { $$ = $3; } + | /*EMPTY*/ { $$ = NIL; } + ; which keeps options 1 and 3 of the list above. Note: you don't need to worry about WITH_LA, because that's only going to show up when the user writes WITH TIME or WITH ORDINALITY (see parser.c), and that's a syntax error anyway. [1] https://postgr.es/m/202510101352.vvp4p3p2dblu@alvherre.pgsql -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La virtud es el justo medio entre dos defectos" (Aristóteles)