X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3D13AD1B196 for ; Tue, 6 Jul 2004 18:39:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92321-10 for ; Tue, 6 Jul 2004 21:39:49 +0000 (GMT) Received: from cmailg2.svr.pol.co.uk (cmailg2.svr.pol.co.uk [195.92.195.172]) by svr1.postgresql.org (Postfix) with ESMTP id 7D1F9D1B1DC for ; Tue, 6 Jul 2004 18:39:45 -0300 (ADT) Received: from modem-424.monkey.dialup.pol.co.uk ([217.135.209.168] helo=[192.168.0.100]) by cmailg2.svr.pol.co.uk with esmtp (Exim 4.14) id 1BhxfF-00020Q-GO; Tue, 06 Jul 2004 22:39:45 +0100 Subject: Re: Point in Time Recovery From: Simon Riggs To: Richard Huxton Cc: Tom Lane , pgsql-hackers@postgresql.org In-Reply-To: <40EAF6E3.9090508@archonet.com> References: <1089060299.17493.58.camel@stromboli> <4263.1089064016@sss.pgh.pa.us> <1089069104.17493.132.camel@stromboli> <40EAF6E3.9090508@archonet.com> Content-Type: text/plain Organization: 2nd Quadrant Message-Id: <1089149984.17493.268.camel@stromboli> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 06 Jul 2004 22:39:44 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/331 X-Sequence-Number: 55892 On Tue, 2004-07-06 at 20:00, Richard Huxton wrote: > Simon Riggs wrote: > > On Mon, 2004-07-05 at 22:46, Tom Lane wrote: > > > >>Simon Riggs writes: > >> > >>>Should we use a different datatype than time_t for the commit timestamp, > >>>one that offers more fine grained differentiation between checkpoints? > >> > >>Pretty much everybody supports gettimeofday() (time_t and separate > >>integer microseconds); you might as well use that. Note that the actual > >>resolution is not necessarily microseconds, and it'd still not be > >>certain that successive commits have distinct timestamps --- so maybe > >>this refinement would be pointless. You'll still have to design a user > >>interface that allows selection without the assumption of distinct > >>timestamps. > > > > > > Well, I agree, though without the desired-for UI now, I think some finer > > grained mechanism would be good. This means extending the xlog commit > > record by a couple of bytes...OK, lets live a little. > > At the risk of irritating people, I'll repeat what I suggested a few > weeks ago... > All feedback is good. Thanks. > Add a table: pg_pitr_checkpt (pitr_id SERIAL, pitr_ts timestamptz, > pitr_comment text) > Let the user insert rows in transactions as desired. Let them stop the > restore when a specific (pitr_ts,pitr_comment) gets inserted (or on > pitr_id if they record it). > It's a good plan, but the recovery is currently offline recovery and no SQL is possible. So no way to insert, no way to access tables until recovery completes. I like that plan and probably would have used it if it was viable. > IMHO time is seldom relevant, event boundaries are. > Agreed, but time is the universally agreed way of describing two events as being simultaneous. No other way to say "recover to the point when the message queue went wild". As of last post to Andreas, I've said I'll not bother changing the granularity of the timestamp. > If you want to add special syntax for this, fine. If not, an INSERT > statement is a convenient way to do this anyway. The special syntax isn't hugely important - I did suggest a kind of SQL-like syntax previously, but thats gone now. Invoking recovery via a command file IS, so we are able to tell the system its not in crash recovery AND that when you've finished I want you to respond to crashes without re-entering archive recovery. Thanks for your comments. I'm not making this more complex than needs be; in fact much of the code is very simple - its just the planning that's complex. Best regards, Simon Riggs