Re: BUG #18224: message bug in libpqwalreceiver.c.

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: king tomo <t(dot)katsumata1122(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18224: message bug in libpqwalreceiver.c.
Date: 2023-12-04 12:12:27
Message-ID: C35E2C78-AA74-4115-8A25-A3D425349604@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 4 Dec 2023, at 12:28, king tomo <t(dot)katsumata1122(at)gmail(dot)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

Attachment Content-Type Size
identify_system_msg.diff application/octet-stream 1.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Orlov Aleksej 2023-12-04 12:51:22 RE: BUG #18223: There is a confusing result where an update statement can reference itself and execute successfully.
Previous Message king tomo 2023-12-04 11:28:37 Re: BUG #18224: message bug in libpqwalreceiver.c.