On Mon, Mar 27, 2017 at 4:48 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> "Tsunakawa, Takayuki" <tsunakawa.ta...@jp.fujitsu.com> writes: > > All other places in twophase.c and most places in other files put > ereport() and errmsg() on separate lines. I think it would be better to > align with surrounding code. > > > + ereport(FATAL, (errmsg("corrupted > two-phase file \"%s\"", > > Actually, the *real* problem with that coding is it lacks a SQLSTATE > (errcode call). The only places where it's acceptable to leave that > out are for internal "can't happen" cases, which this surely isn't. > Surrounding code also has ereports lacking SQLSTATE. And that isn't "can't happen" case as well. if (ControlFile->backupEndRequired) > ereport(FATAL, > (errmsg("WAL ends before end of online backup"), > errhint("All WAL generated while online backup was taken must be > available at recovery."))); > else if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint)) > ereport(FATAL, > (errmsg("WAL ends before end of online backup"), > errhint("Online backup started with pg_start_backup() must be ended with > pg_stop_backup(), and all WAL up to that point must be available at > recovery."))); > else > ereport(FATAL, > (errmsg("WAL ends before consistent recovery point"))); Should we consider fixing them? ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company