Re: pg_archive_bypass - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_archive_bypass
Date
Msg-id 201006300245.o5U2jCG23703@momjian.us
Whole thread Raw
In response to pg_archive_bypass  (Dimitri Fontaine <dfontaine@hi-media.com>)
Responses Re: pg_archive_bypass  (Dimitri Fontaine <dfontaine@hi-media.com>)
List pgsql-hackers
Dimitri Fontaine wrote:
> Hi,
>
> I tend to consider it a bug that there's no known way under windows to
> use the same trick as under Unix by using '/usr/bin/true' as your
> archive command. And this Unix trick itself does feel like a hack.
>
> Also I'd very much like to be able to recommend (even if not change the
> official defaults) to setup wal_level to archive, archive_mode=on and
> archive_command=pg_archive_bypass, so that the day you have a HA budget
> ain't the day you're going to restart the server to enable the fault
> tolerance settings?
>
> So please find attached a very simple "let's see about it" patch to
> implement an internal archive_command that just returns true and is
> called pg_archive_bypass. It's missing documentation, which I'll provide
> if needed (meaning there's some will to consider applying such a patch).

Turn out 'REM' acts like /bin/true on Windows.  I have documented that
fact in the attached, applied patch.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +
Index: doc/src/sgml/config.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/config.sgml,v
retrieving revision 1.287
diff -c -c -r1.287 config.sgml
*** doc/src/sgml/config.sgml    29 Jun 2010 22:29:13 -0000    1.287
--- doc/src/sgml/config.sgml    30 Jun 2010 02:40:40 -0000
***************
*** 1793,1799 ****
          disabled, but the server continues to accumulate WAL segment files in
          the expectation that a command will soon be provided.  Setting
          <varname>archive_command</> to a command that does nothing but
!         return true, e.g. <literal>/bin/true</>, effectively disables
          archiving, but also breaks the chain of WAL files needed for
          archive recovery, so it should only be used in unusual circumstances.
         </para>
--- 1793,1800 ----
          disabled, but the server continues to accumulate WAL segment files in
          the expectation that a command will soon be provided.  Setting
          <varname>archive_command</> to a command that does nothing but
!         return true, e.g. <literal>/bin/true</> (<literal>REM</> on
!         Windows), effectively disables
          archiving, but also breaks the chain of WAL files needed for
          archive recovery, so it should only be used in unusual circumstances.
         </para>

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Proposal for 9.1: WAL streaming from WAL buffers
Next
From: Fujii Masao
Date:
Subject: Re: keepalives on MacOS X