Re: Implement waiting for wal lsn replay: reloaded
| От | Chao Li |
|---|---|
| Тема | Re: Implement waiting for wal lsn replay: reloaded |
| Дата | |
| Msg-id | C015C9FA-5FCE-4984-9F82-F1F2BC0EACF3@gmail.com обсуждение исходный текст |
| Ответ на | Re: Implement waiting for wal lsn replay: reloaded (Álvaro Herrera <alvherre@kurilemu.de>) |
| Ответы |
Re: Implement waiting for wal lsn replay: reloaded
|
| Список | pgsql-hackers |
> On Dec 30, 2025, at 11:14, Álvaro Herrera <alvherre@kurilemu.de> wrote:
>
> On 2025-Dec-27, Xuneng Zhou wrote:
>
>> On Fri, Dec 26, 2025 at 4:25 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
>>> 2 - 0002
>>> ```
>>> + else
>>> + ereport(ERROR,
>>> + (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
>>> + errmsg("unrecognized value for WAIT option \"%s\": \"%s\"",
>>> + "MODE", mode_str),
>>> ```
>>>
>>> I wonder why don’t we directly put MODE into the error message?
>>
>> Yeah, putting MODE into the error message is cleaner. It's done in v8.
>
> The reason not to do that (and also put WAIT in a separate string) is so
> that the message is identicla to other messages and thus requires no
> separate translation, specifically
> errmsg("unrecognized value for %s option \"%s\": \"%s\"", ...)
>
> See commit 502e256f2262. Please use that form.
>
To follow 502e256f2262, it should use “%s” for “WAIT” as well. I raised the comment because I saw “WAIT” is the format
strings,thus “MODE” can be there as well.
So, we should do a similar change like:
```
- errmsg("unrecognized value for EXPLAIN option \"%s\": \"%s\"",
- opt->defname, p),
+ errmsg("unrecognized value for %s option \"%s\": \"%s\"",
+ "EXPLAIN", opt->defname, p),
```
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления: