Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 880986326BC for ; Thu, 17 Jun 2010 20:25:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 95385-02 for ; Thu, 17 Jun 2010 23:25:20 +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 634EF632189 for ; Thu, 17 Jun 2010 20:25:21 -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 o5HNPBgV028138; Thu, 17 Jun 2010 19:25:11 -0400 (EDT) To: Josh Berkus cc: postgres performance list Subject: Re: PostgreSQL as a local in-memory cache In-reply-to: <4C1AA949.7050301@agliodbs.com> References: <18287446-8677-46d6-a581-c4777f60ebda@40g2000pry.googlegroups.com> <4C1A5B81.8050908@agliodbs.com> <4C1AA949.7050301@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Thu, 17 Jun 2010 16:01:29 -0700" Date: Thu, 17 Jun 2010 19:25:11 -0400 Message-ID: <28137.1276817111@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/322 X-Sequence-Number: 39178 Josh Berkus writes: >> (a) and (d) are probably simple, if by "reprovisioning" you mean >> "rm -rf $PGDATA; initdb". > Exactly. Followed by "scp database_image". Or heck, just replacing the > whole VM. Right, that would work. I don't think you really need to implement that inside Postgres. I would envision having the startup script do it, ie rm -rf $PGDATA cp -pr prepared-database-image $PGDATA # this loop exits when postmaster exits normally while ! postmaster ... do rm -rf $PGDATA cp -pr prepared-database-image $PGDATA done Then all you need is a tweak to make the postmaster exit(1) after a crash instead of trying to launch recovery. regards, tom lane