Re: BUG #18224: message bug in libpqwalreceiver.c.
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: king tomo <t.katsumata1122@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-12-04T12:12:27Z
Lists: pgsql-bugs
Attachments
- identify_system_msg.diff (application/octet-stream) patch
> On 4 Dec 2023, at 12:28, king tomo <t.katsumata1122@gmail.com> wrote:
> This is a simplest patch.
> Please check it.
This dates back to 5a991ef8692e from March 2014 which has this hunk:
- errdetail("Expected 1 tuple with 3 fields, got %d tuples with %d fields.",
- ntuples, nfields)));
+ errdetail("Could not identify system: Got %d rows and %d fields, expected %d rows and %d or more fields.",
+ ntuples, nfields, 3, 1)));
> Also, it seems that the decision to return 4 fields in 9.4 was not
> reflected.
Actually it was, 083d29c65b78 changed it like your patch but it was then later
reverted in c4762886539b since it prevents using replication related utils
against older servers. Maybe it's time to drop this backwards compatibility
now but that shouldn't be hidden in an error message fixup patch. I've changed
it to add a comment instead which explains why we check for < 3 and write that
we expect 4 in the error message. It could be argued that we should say that
we expect "3 or more" fields but given the age of the change we clearly do
expect 4 at this point.
I'll apply this backpatched all the way down unless there are objections.
--
Daniel Gustafsson
Commits
-
Fix typo in comment
- d86038bd4d81 14.11 landed
- c5962ad21a6e 17.0 landed
- 810c9609f8a5 16.2 landed
- 5902ba5b21da 12.18 landed
- 419b6cb885a5 15.6 landed
- 00b222226f81 13.14 landed