title: Can Background Worker Processes access data directly using shared-memory in PostgreSQL?
body: <p>The current <a href="https://www.postgresql.org/docs/current/bgworker.html" rel="nofollow noreferrer">documentation</a> seems (to me) to imply that you need to use a DB connection to read/write data in PostgreSQL, just like a "normal client", but some articles on the web seem to imply that you can implement some form of "replication" using <em>shared-memory</em> in Background Worker Processes, with a recent versions of PostgreSQL. I might have understood that incorrectly.</p>
  
  <p>So, can Background Worker Processes access (read/write) data directly using <em>shared-memory</em> in PostgreSQL?</p>
  
  <p>The purpose of the question is to know if (measurable) performance benefits could be achieved using this, presumably complicated and dangerous, method of access. In an ideal world, I would have wanted to use PostgreSQL as a single-process "embedded" DB, but PG cannot do that. It seems like "Background Worker Processes" + "shared-memory" is the closest I can get to that.</p>
  
  <p>Reasons to not use <em>SQLite</em>, if I want an embedded DB, is lack of support of arrays, and composite types, like in PG. <em>Firebird</em> would be an alternative, but also lack composite types.</p>