From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve SQLSTATE reporting in some replication-related code.
Date: Wed, 16 Jun 2021 15:52:13 +0000
Message-ID: <E1ltXpt-00016L-Sd@gemulon.postgresql.org> (raw)
Improve SQLSTATE reporting in some replication-related code.
I started out with the goal of reporting ERRCODE_CONNECTION_FAILURE
when walrcv_connect() fails, but as I looked around I realized that
whoever wrote this code was of the opinion that errcodes are purely
optional. That's not my understanding of our project policy. Hence,
make sure that an errcode is provided in each ereport that (a) is
ERROR or higher level and (b) isn't arguably an internal logic error.
Also fix some very dubious existing errcode assignments.
While this is not per policy, it's also largely cosmetic, since few
of these cases could get reported to applications. So I don't
feel a need to back-patch.
Discussion: https://postgr.es/m/2189704.1623512522@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6b787d9e32005867ee3660d1ea20f447810a403d
Modified Files
--------------
src/backend/commands/subscriptioncmds.c | 29 ++++++-----
.../libpqwalreceiver/libpqwalreceiver.c | 60 ++++++++++++++--------
src/backend/replication/logical/tablesync.c | 21 +++++---
src/backend/replication/logical/worker.c | 6 ++-
src/backend/replication/walreceiver.c | 19 ++++---
5 files changed, 88 insertions(+), 47 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve SQLSTATE reporting in some replication-related code.
In-Reply-To: <E1ltXpt-00016L-Sd@gemulon.postgresql.org>
References: <E1ltXpt-00016L-Sd@gemulon.postgresql.org>
* 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