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 1wCF82-001nJ9-2Z for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 11:06:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCF81-006Rq6-0J for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 11:06:54 +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 1wCF80-006Rpx-2b for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 11:06:53 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCF7z-00000000moh-2qVx for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 11:06:52 +0000 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7dc3d28e2f3so1554540a34.0 for ; Mon, 13 Apr 2026 04:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776078411; cv=none; d=google.com; s=arc-20240605; b=It7hdKvwU+w2V0X10V6ZzkgKZ4mJd2ZN/AILxN3WtY0iLWlOqb2845smmaqF9ozS3s 8NVPDWefb+7NqcwMdxQlQY1LpOisbdQ3MufQPeQqCTPuNMJ6IWrP0XYrlmhB5rsuGRRH eeCKdYI7ffPhqhsCJOSvZgFC1+Pc7wHfzstqb8pbOsB63XOiG22AbN1dZ8JsebMRDSvS 3ER22jC8d0O33aVeBpe7VhgdQ+34XMOqunWOtMJOU4AepKVuDtT02ZsVF41yX4R/CZlM hyrhcAH0pFpKL/H+Y6p3s4QNVxoHtOov5bbqGrDEZ86582btl2Xt2ZOa/hNNt55CNs0L a13A== 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=NWPmgbA2t6mXEz4GtA5VpSjSS10rNGh/WmW2G3yJClA=; fh=DHmEJ1rXF4Bm+VI4/PTuMlRNHwXvuWL5hhxcvU3+qMs=; b=A8z1C0jHyQbOIPB6/DMbsQ4an5umf6gM5jrruAIdE9jLI01t48nzlgDC73A0Wp6IoD 6o6aAnDy+5XNCjnx0sz/mC3dmx/vPRf5n7+0IbtuvRN4vnrJfB3RlmlxIn7ZIMFWcESf sry3k0k5frgdUVNMEJtadpCzsGKAR7Jw3oAILd285ATQhsDBpAaQ1kJVibRvpM73XtCK ngBBieulrl+b+S5WKmHFileD26j3yhGVumUNwpTghGelJ6kiTz5XUB8JwsV30u8q/2GP ZhahLpEd9BzccY4QthRIy1uF0Z40aMk4ZSRB85DZZAlVaM3Lok2Ujg+4S29zNMmQn0qe /YcQ==; 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=gmail.com; s=20251104; t=1776078411; x=1776683211; 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=NWPmgbA2t6mXEz4GtA5VpSjSS10rNGh/WmW2G3yJClA=; b=b5DB6aRgzPxF9VodvfIS8D8dtyO4vd3nGNUs10DO6reOYo8p527y8siTHzj7dyJexG s3mKNZugLFSeIBfj4tm4Cv/xKpAdbemZ56bFZNnf1CRvCM6T8BByNdNAJdEtktWEQcgW 9ghVAf6LsK4T7WIKV6yX2294UFCxr65kdXmNf1ZRNscC3Aby0znTlqfMTL/f4xravOuN zuTIELvUoYX82kBtueLSD1jzAm0y3gSRy8kcnjb5pqp5snP6qaRFTmqXD5ExlW2jrn72 45RoJV8rJ9ZY2d3KBOZlBY8Dsxo7gRQuw2ebrbsKU9kDA4UXsxjThAfspxjbs3Zy0Bs0 xjrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776078411; x=1776683211; 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=NWPmgbA2t6mXEz4GtA5VpSjSS10rNGh/WmW2G3yJClA=; b=T+/vBfmP2kWIsp+/xiY9d3khHj8riw8OlVZkVTVR0m16JYpfcDzJa6ENFc7a+SdBaR /wcgWMQLnDS3J5lKv0WmmKKXdXQObhIfSEPBLP2QlTLeH5eeThwim2kTKIYuKYRnd41E 2Wyvmfor89R223k/WYM3dWdI4+z1dkLFPScop9VUG+CxDK1ZI4BpVFmc5tQ0R2ctljWv aspFqZpiQ6OCmiaSSfCyudYb13Eplsqdc6PbYOs/wkSzV+hFGwfy0RXgEbCkSNxanUOn LdD7xnbcCEvalUxmwDY9mAJbqhpzJexsuNL/M/6w8EBR0HB6WfeT8e7u8lU8c7mWtCHv o/OQ== X-Forwarded-Encrypted: i=1; AFNElJ+1GmJa2bBX4YfrZ9EvLAr9NCigl68uF76L6kI/AT+eMJOxelvE3qjRIxyoAs2KzP6W7grwi50mRXUIQOZA@lists.postgresql.org X-Gm-Message-State: AOJu0YwZ7zu/On3YIoRY00aKS+zmsOP1wYAQRixShzafqtAuLMx9LYzx YwrbvzdYM/V8Q32T14gMRKD4cpBSdyGXQscELR7TnUVgtbtoR2IU47TfGwDdYRD0TNntkTjr4lU q9Dc9aWmKvcJPkW903FZHi9NOkhDPEVc= X-Gm-Gg: AeBDievClAkTWiBjQYqvFhqN6zvHWGC1Dqf9HPygli8JEVcSAZRSDccbcJNe2lnEcti eqhMEhDGGcCuRn7uHGMVUtM7yv0lt1yqjkRTvdqJRLbtOk0MC2gIUoGsYlBDH6K8A+yUe4kWYkb /wZz7ncVJ0gpnZ1SsYMo7lYzZ+o9avhRmADVx4adFvUgpS0lMb3uqBUXQqXtkJcjQdK5pY/iPMp 09qrILxDd/XNQ74pbjse4bTwA3g7ndiJh6/jpL7Jldab76P1QPJODpPQoOx5yec7Imq7MKBx3An 1z5KKKmoap2jORNe1vqc5e0FxjsLcrIxhW1+dwVdEaC51x/4Tb5P3OTfjBJoFPofuE8jFSjqrEj FIx5n5rdqjf/oEXzrLuYB8ouaqRafnyyexITjQdw= X-Received: by 2002:a05:6820:174b:b0:68d:1e12:ed19 with SMTP id 006d021491bc7-68d1e223684mr4687039eaf.20.1776078411416; Mon, 13 Apr 2026 04:06:51 -0700 (PDT) MIME-Version: 1.0 References: <3cc93f9.1ab.19d74a26acf.Coremail.wxp_728@163.com> In-Reply-To: From: Alexander Korotkov Date: Mon, 13 Apr 2026 14:06:38 +0300 X-Gm-Features: AQROBzDjbrbOu6OkPfrASPM-tkOD3kVjWNZ5aicaxg4kwAVERY9hjkUr3k-hcNk Message-ID: Subject: Re: Re: Bug: WAIT FOR LSN crashes with assertion failure inside PL/pgSQL DO blocks and procedures To: Xuneng Zhou Cc: "wang.xiao.peng" , SATYANARAYANA NARLAPURAM , PostgreSQL Hackers , PostgreSQL-development 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 On Fri, Apr 10, 2026 at 10:36=E2=80=AFAM Xuneng Zhou = wrote: > I=E2=80=99ve revised the patch. Moving the non=E2=80=93top-level rejectio= n to the > beginning of the function may help avoid unnecessary parsing and > validation work, although it could make the reasoning slightly less > localized. > > Since this is user-facing, should we explicitly document this > constraint to make the behavior less surprising? The rejection applies > not only to wrapping the command in a procedure or function, but also > within a DO block. > > It might also be worth adding a regression test and refining the error > message accordingly. With this new constraint, some existing comments > were outdated and have been updated as well. Accepted, thank you. Also, I've added errdetail() to clarify when the statement could be not top-level. Pushed. ------ Regards, Alexander Korotkov Supabase