Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 63E181337BBB for ; Fri, 18 Mar 2011 22:13:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 17840-06 for ; Sat, 19 Mar 2011 01:12:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id D254A133616B for ; Fri, 18 Mar 2011 22:12:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p2J1CqbU027266; Fri, 18 Mar 2011 21:12:52 -0400 (EDT) To: Robert Haas cc: Fujii Masao , Simon Riggs , PostgreSQL-development Subject: Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication. In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Fri, 18 Mar 2011 10:10:03 -0400" Date: Fri, 18 Mar 2011 21:12:52 -0400 Message-ID: <27265.1300497172@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.409 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: ** X-Archive-Number: 201103/1185 X-Sequence-Number: 184435 Robert Haas writes: > As a side note, it's not very obvious why some parts of PostmasterMain > report problems by doing write_stderr() and exit() while other parts > use ereport(ERROR). This check and the nearby checks on WAL level are > immediately preceded and followed by other checks that use the > opposite technique. This question is answered in postmaster.c's header comment: * Error Reporting: * Use write_stderr() only for reporting "interactive" errors * (essentially, bogus arguments on the command line). Once the * postmaster is launched, use ereport(). In particular, don't use * write_stderr() for anything that occurs after pmdaemonize. Code that is involved in GUC variable processing is in a gray area, though, since it can be invoked both before and after pmdaemonize. It might be a good idea to convert all the calls into ereports and maintain a state flag in elog.c to determine what to do. regards, tom lane