aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/xml.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-09-07 14:12:31 +0900
committerMichael Paquier <michael@paquier.xyz>2023-09-07 14:12:31 +0900
commit9de74ca706f64ff44bac7ba54209dd1a6eabdb45 (patch)
tree63e4de15ac66b0ac4f3bb4cdbee45240ad5abd83 /src/backend/utils/adt/xml.c
parenta8e897e8beaf1a6c2d0bee0705fe1d2fffb3d338 (diff)
downloadpostgresql-9de74ca706f64ff44bac7ba54209dd1a6eabdb45.tar.gz
postgresql-9de74ca706f64ff44bac7ba54209dd1a6eabdb45.zip
pg_basebackup: Generate valid temporary slot names under PQbackendPID()
pgbouncer can cause PQbackendPID() to return negative values due to it filling be_pid with random bytes (even these days pid_max can only be set up to 2^22 on 64b machines on Linux, for example, so this cannot happen with normal PID numbers). When this happens, pg_basebackup may generate a temporary slot name that may not be accepted by the parser, leading to spurious failures, like: pg_basebackup: error: could not send replication command ERROR: replication slot name "pg_basebackup_-1201966863" contains invalid character This commit fixes that problem by formatting the result from PQbackendPID() as an unsigned integer when creating the temporary replication slot name, so as the invalid character is gone and the command can be parsed. Author: Jelte Fennema Reviewed-by: Daniel Gustafsson, Nishant Sharma Discussion: https://postgr.es/m/CAGECzQQOGvYfp8ziF4fWQ_o8s2K7ppaoWBQnTmdakn3s-4Z=5g@mail.gmail.com Backpatch-through: 11
Diffstat (limited to 'src/backend/utils/adt/xml.c')
0 files changed, 0 insertions, 0 deletions