postgresql/src/backend
Michael Paquier 2d77d83540 Refactor the syslogger pipe protocol to use a bitmask for its options
The previous protocol expected a set of matching characters to check if
a message sent was the last one or not, that changed depending on the
destination wanted:
- 't' and 'f' tracked the last message of a log sent to stderr.
- 'T' and 'F' tracked the last message of a log sent to csvlog.

This could be extended with more characters when introducing new
destinations, but using a bitmask is much more elegant.  This commit
changes the protocol so as a bitmask is used in the header of a log
chunk message sent to the syslogger, with the following options
available for now:
- log_destination as stderr.
- log_destination as csvlog.
- if a message is the last chunk of a message.

Sehrope found this issue in a patch set to introduce JSON as an option
for log_destination, but his patch made the size of the protocol header
larger.  This commit keeps the same size as the original, and adapts the
protocol as wanted.

Thanks also to Andrew Dunstan and Greg Stark for the discussion.

Author: Michael Paquier, Sehrope Sarkuni
Discussion: https://postgr.es/m/CAH7T-aqswBM6JWe4pDehi1uOiufqe06DJWaU5=X7dDLyqUExHg@mail.gmail.com
2021-09-13 09:03:45 +09:00
..
access Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Remove Value node struct 2021-09-09 08:36:53 +02:00
commands Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
executor Remove Value node struct 2021-09-09 08:36:53 +02:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Fix incorrect format placeholders 2021-09-08 08:57:05 +02:00
main process startup: Centralize pgwin32_signal_initialize() calls. 2021-08-05 12:36:06 -07:00
nodes Fix _equalA_Const 2021-09-09 10:23:29 +02:00
optimizer Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
parser Remove Value node struct 2021-09-09 08:36:53 +02:00
partitioning Allow ordered partition scans in more cases 2021-08-03 12:25:52 +12:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:09:00 +12:00
postmaster Refactor the syslogger pipe protocol to use a bitmask for its options 2021-09-13 09:03:45 +09:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Fix issue with WAL archiving in standby. 2021-09-09 23:56:57 +09:00
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
storage Check for relation length overrun soon enough. 2021-09-09 11:45:48 -04:00
tcop Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
tsearch Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
utils Refactor the syslogger pipe protocol to use a bitmask for its options 2021-09-13 09:03:45 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00