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 1lI3Ej-0000Gn-3e for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Mar 2021 05:42:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lI3Eg-0005hC-9P for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Mar 2021 05:42:50 +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 1lI3Eg-0005h5-34 for pgsql-bugs@lists.postgresql.org; Fri, 05 Mar 2021 05:42:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lI3Ed-000562-Pm for pgsql-bugs@lists.postgresql.org; Fri, 05 Mar 2021 05:42:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1255ghZ31443267; Fri, 5 Mar 2021 00:42:43 -0500 From: Tom Lane To: Michael Paquier cc: Alvaro Herrera , r.zharkov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set. In-reply-to: References: <20210304211356.GA21621@alvherre.pgsql> <1418361.1614896097@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Fri, 05 Mar 2021 14:30:20 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1443265.1614922963.1@sss.pgh.pa.us> Date: Fri, 05 Mar 2021 00:42:43 -0500 Message-ID: <1443266.1614922963@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Thu, Mar 04, 2021 at 05:14:57PM -0500, Tom Lane wrote: >> Since the alleged point of this module is to be a prototype for >> useful background workers, I think we should think of another way. >> Maybe we need to work a bit harder on passing values from >> worker_spi_launch to the worker, so that the DB name could be a >> parameter to worker_spi_launch. > Yeah, or this is converted to a TAP test where we don't care about > the database used, but that would consume more cycles without more > coverage done. Don't we need to worry about the memory context where > bgw_main_arg is pushed into for dynamic workers? Yeah, the fact that bgw_main_arg is declared as Datum is really kind of a lie, because the only thing that actually works there is a pass by value datatype (not that our docs tell you so). We could stuff the database name into bgw_extra perhaps, but that seems restrictive as well. I wonder if there's a reasonable way to pass over a struct of caller-defined size. regards, tom lane