> That gets complicated with translation, because you need to translate the %s > arguments need to be translated separately, as the translation cannot be done > together with the error/detail message. Doable, but it's not an no-cost win.
I am aware of this, but the translation can be again at one place at the end. As for the cost, if I understand correctly in this error path the server has already generated possibly many log messages already, is one more translation really a significant cost that we have to worry about? I would also probably add the first slightly different if into the same message, by adding the two counts together, and mentioning "invalid pages or checksum errors" at the end - since we already suggest checking the server logs for more details, is it useful to display 2 separate exact counts for that? And that way we have only 1 error message for everything. > and introducing a function-scoped macro to reduce the repetitive ereport() > structure I tried something similar initially, but I didn't find this too readable
