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