Re: Transaction timeout

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Andrey Borodin <amborodin86(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Transaction timeout
Date: 2023-09-01 20:23:07
Message-ID: af8af2ea-a4f5-271e-26e9-01a4584d73d9@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12.01.23 20:46, Andrey Borodin wrote:
>> On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote:
>>> I've rewritten this part to correctly report all timeouts that did
>>> happen. However there's now a tricky comma-formatting code which was
>>> tested only manually.
>> I suspect this will make translation difficult.
> I use special functions for this like _()
>
> char* lock_reason = lock_timeout_occurred ? _("lock timeout") : "";
>
> and then
> ereport(ERROR, (errcode(err_code),
> errmsg("canceling statement due to %s%s%s%s%s", lock_reason, comma1,
> stmt_reason, comma2, tx_reason)));
>
> I hope it will be translatable...

No, you can't do that. You have to write out all the strings separately.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-09-01 20:52:48 Re: Inefficiency in parallel pg_restore with many tables
Previous Message Robert Haas 2023-09-01 20:21:42 Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)