Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Date
Msg-id alpine.DEB.2.21.1807112124210.27883@lancre
Whole thread Raw
In response to Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors  (Marina Polyakova <m.polyakova@postgrespro.ru>)
Responses Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors  (Marina Polyakova <m.polyakova@postgrespro.ru>)
List pgsql-hackers

> can we try something like this?
>
> PGBENCH_ERROR_START(DEBUG_FAIL)
> {
>     PGBENCH_ERROR("client %d repeats the failed transaction (try %d",

Argh, no? I was thinking of something much more trivial:

    pgbench_error(DEBUG, "message format %d %s...", 12, "hello world");

If you really need some complex dynamic buffer, and I would prefer 
that you avoid that, then the fallback is:

    if (level >= DEBUG)
    {
       initPQstuff(&msg);
       ...
       pgbench_error(DEBUG, "fixed message... %s\n", msg);
       freePQstuff(&msg);
    }

The point is to avoid building the message with dynamic allocation and so
if in the end it is not used.

-- 
Fabien.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints
Next
From: Tom Lane
Date:
Subject: Re: make installcheck-world in a clean environment