Re: Call perror on popen failure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Pgsql Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Call perror on popen failure
Date: 2024-03-08 15:24:48
Message-ID: 793164.1709911488@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> If popen fails in pipe_read_line we invoke perror for the error message, and
> pipe_read_line is in turn called by find_other_exec which is used in both
> frontend and backend code. This is an old codepath, and it seems like it ought
> to be replaced with the more common logging tools we now have like in the
> attached diff (which also makes the error translated as opposed to now). Any
> objections to removing this last perror() call?

I didn't check your replacement code in detail, but I think we have
a policy against using perror, mainly because we can't count on it
to localize consistently with ereport et al. My grep confirms this
is the only use, so +1 for removing it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-03-08 15:31:45 Re: type cache cleanup improvements
Previous Message Bertrand Drouvot 2024-03-08 15:04:10 Re: Spurious pgstat_drop_replslot() call