pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: r.zharkov@postgrespro.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.
Date: Fri, 5 Mar 2021 15:19:26 +0900
Message-ID: <YEHNbqufuVecA9IS@paquier.xyz> (raw)
In-Reply-To: <1443266.1614922963@sss.pgh.pa.us>
References: <20210304211356.GA21621@alvherre.pgsql>
	<1418361.1614896097@sss.pgh.pa.us>
	<YEHB7A2c+qzpZ2+J@paquier.xyz>
	<1443266.1614922963@sss.pgh.pa.us>

On Fri, Mar 05, 2021 at 12:42:43AM -0500, Tom Lane wrote:
> 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).

Exactly.

> 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.

Or we could just rely on a custom memory context that dynamic workers
could use to store their data?  It could be simpler IMO to just merge
together bgw_main_arg and bgw_extra, then pass down the whole as an
argument of the main routine of the bgworker, say with a buffer of 256
bytes for example.  I am not sure that workers really need that much
for themselves at startup out of GUCs, but I may be wrong :)
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (8+ messages)  latest in thread

Message-ID: <YEHNbqufuVecA9IS@paquier.xyz>
Permalink:  ../YEHNbqufuVecA9IS@paquier.xyz/
Also on:    postgresql.org/message-id/YEHNbqufuVecA9IS@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, 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: <YEHNbqufuVecA9IS@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox