pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Marina Polyakova <m.polyakova@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org, Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Date: Wed, 13 Jun 2018 15:59:24 -0400
Message-ID: <20180613195924.tcrdisjrat2se2rt@alvherre.pgsql> (raw)
In-Reply-To: <alpine.DEB.2.21.1806132128500.24891@lancre>

On 2018-Jun-13, Fabien COELHO wrote:

> > > > With that, is there a need for elog()?  In the backend we have
> > > > it because $HISTORY but there's no need for that here -- I
> > > > propose to lose elog() and use only ereport everywhere.
> 
> See commit 8a07ebb3c172 which turns some ereport into elog...

For context: in the backend, elog() is only used for internal messages
(i.e. "can't-happen" conditions), and ereport() is used for user-facing
messages.  There are many things ereport() has that elog() doesn't, such
as additional message fields (HINT, DETAIL, etc) that I think could have
some use in pgbench as well.  If you use elog() then you can't have that.

Another difference is that in the backend, elog() messages are never
translated, while ereport() message are translated.  Since pgbench is
translatable I think it would be best to keep those things in sync, to
avoid confusion. (Although of course you could do it differently in
pgbench than backend.)

One thing that just came to mind is that pgbench uses some src/fe_utils
stuff.  I hope having ereport() doesn't cause a conflict with that ...

BTW I think abort() is not the right thing, as it'll cause core dumps if
enabled.  Why not just exit(1)?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (137+ messages)  latest in thread

Message-ID: <20180613195924.tcrdisjrat2se2rt@alvherre.pgsql>
Permalink:  ../20180613195924.tcrdisjrat2se2rt@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180613195924.tcrdisjrat2se2rt@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, coelho@cri.ensmp.fr, m.polyakova@postgrespro.ru, i.kurbangaliev@postgrespro.ru, teodor@sigaev.ru
  Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
  In-Reply-To: <20180613195924.tcrdisjrat2se2rt@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox