Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQcIw-0000dd-Ja for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Apr 2020 19:42:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQcIv-0007QJ-AW for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Apr 2020 19:42:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQcIv-0007QC-4p for pgsql-bugs@lists.postgresql.org; Mon, 20 Apr 2020 19:42:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQcIs-0000U2-V4 for pgsql-bugs@lists.postgresql.org; Mon, 20 Apr 2020 19:42:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 03KJg03j014163; Mon, 20 Apr 2020 15:42:00 -0400 From: Tom Lane To: John Muehlhausen cc: "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" Subject: Re: NOTIFY in multi-statement PQexec() not sent outside of transaction In-reply-to: References: Comments: In-reply-to John Muehlhausen message dated "Mon, 20 Apr 2020 14:32:05 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14160.1587411720.1@sss.pgh.pa.us> Date: Mon, 20 Apr 2020 15:42:00 -0400 Message-ID: <14161.1587411720@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk John Muehlhausen writes: > Wrapping the notify in a transaction does not fix it. Shouldn't the notify > be available as soon as the containing transaction is committed? A notify message will be sent to the client when the backend is (a) idle (*not* in the middle of processing a transaction string) and (b) not in an open transaction. You appear to be unhappy with point (a), but I think changing that would break more clients than it fixes. It's intentional that we don't send notifies mid-command, and this sure looks like a variant of mid-command from here. regards, tom lane