Re: pg_log_fatal vs pg_log_error

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_log_fatal vs pg_log_error
Date: 2019-06-17 14:34:36
Message-ID: c3bae0c8-9fda-2b0d-f3be-90fe069da0af@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-06-17 14:19, Antonin Houska wrote:
> Can anyone please give me a hint (and possibly add some comments to the code)
> when pg_log_fatal() should be used in frontend code and when it's appropriate
> to call pg_log_error()? The current use does not seem very consistent.

For a program that runs in a loop, like for example psql or
pg_receivewal, use error if the program keeps running and fatal if not.
For one-shot programs like for example createdb, there is no difference,
so we have used error in those cases.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-06-17 14:40:57 Allow an alias to be attached directly to a JOIN ... USING
Previous Message Stephen Frost 2019-06-17 14:33:11 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)