postgresql/src
Álvaro Herrera 0c8e082fba
Assign "backend" type earlier during process start-up
Instead of assigning the backend type in the Main function of each
postmaster child, do it right after fork(), by which time it is already
known by postmaster_child_launch().  This reduces the time frame during
which MyBackendType is incorrect.

Before this commit, ProcessStartupPacket would overwrite MyBackendType
to B_BACKEND for dead-end backends, which is quite dubious.  Stop that.

We may now see MyBackendType == B_BG_WORKER before setting up
MyBgworkerEntry.  As far as I can see this is only a problem if we try
to log a message and %b is in log_line_prefix, so we now have a constant
string to cover that case.  Previously, it would print "unrecognized",
which seems strictly worse.

Author: Euler Taveira <euler@eulerto.com>
Discussion: https://postgr.es/m/e85c6671-1600-4112-8887-f97a8a5d07b2@app.fastmail.com
2026-02-04 16:56:57 +01:00
..
backend Assign "backend" type earlier during process start-up 2026-02-04 16:56:57 +01:00
bin pg_resetwal: Fix incorrect error message related to pg_wal/summaries/ 2026-02-04 16:38:06 +09:00
common Fix accidentally cast away qualifiers 2026-01-26 16:02:31 +01:00
fe_utils Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
include Add backendType to PGPROC, replacing isRegularBackend 2026-02-04 13:06:04 +02:00
interfaces Fix accidentally cast away qualifiers 2026-01-26 16:02:31 +01:00
makefiles tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
pl Refactor att_align_nominal() to improve performance. 2026-02-02 14:39:50 -05:00
port Fix accidentally cast away qualifiers 2026-01-26 16:02:31 +01:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Fix logical replication TAP test to read publisher log correctly. 2026-02-05 00:43:06 +09:00
timezone Update time zone data files to tzdata release 2025c. 2026-01-18 14:54:33 -05:00
tools Move shmem allocator's fields from PGShmemHeader to its own struct 2026-01-30 18:22:56 +02:00
tutorial Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in tests: Add a test C++ extension module 2026-01-20 16:42:30 +01:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00