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

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: BUG #18224: message bug in libpqwalreceiver.c.
Дата
Msg-id C35E2C78-AA74-4115-8A25-A3D425349604@yesql.se
обсуждение исходный текст
Ответ на Re: BUG #18224: message bug in libpqwalreceiver.c.  (king tomo <t.katsumata1122@gmail.com>)
Ответы Re: BUG #18224: message bug in libpqwalreceiver.c.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> 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


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: king tomo
Дата:
Сообщение: Re: BUG #18224: message bug in libpqwalreceiver.c.
Следующее
От: Orlov Aleksej
Дата:
Сообщение: RE: BUG #18223: There is a confusing result where an update statement can reference itself and execute successfully.