Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)
Дата
Msg-id 202311151028.e6ybjt4andio@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Translation-wise, this doesn't work, because you're building a string.
There's no reason to think that the words "logical" and "physical"
should stay untranslated; the message would make no sense, or at least
would be very ugly.

You should do something like

if (am_walsender)
{
    ereport(log_replication_commands ? LOG : DEBUG1,
        SlotIsLogical(s) ? errmsg("acquired logical replication slot \"%s\"", NameStr(s->data.name)) :
        errmsg("acquired physical replication slot \"%s\"", NameStr(s->data.name)));
}

(Obviously, lose the "translator:" comments since they are unnecessary)


If you really want to keep the "logical"/"physical" word untranslated,
you need to split it out of the sentence somehow.  But it would be
really horrible IMO.  Like

errmsg("acquired replication slot \"%s\" of type \"%s\"",
       NameStr(s->data.name), SlotIsLogical(s) ? "logical" : "physical")

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Use it up, wear it out, make it do, or do without"



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

Предыдущее
От: "Tristan Partin"
Дата:
Сообщение: On non-Windows, hard depend on uselocale(3)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Adding facility for injection points (or probe points?) for more advanced tests