X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 7E9D311F8B79 for ; Sat, 15 Apr 2006 14:27:14 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.213 X-Spam-Level: X-Spam-Status: No, score=-2.213 required=5 tests=[AWL=0.388, BAYES_00=-2.599, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id jr9lGnIDrOle for ; Sat, 15 Apr 2006 14:27:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 795B211F8B3B for ; Sat, 15 Apr 2006 14:27:06 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k3FHQvI01801; Sat, 15 Apr 2006 13:26:57 -0400 (EDT) From: Bruce Momjian Message-Id: <200604151726.k3FHQvI01801@candle.pha.pa.us> Subject: Re: Proposed doc-patch: Identifying the Current WAL file In-Reply-To: To: Jeff Frost Date: Sat, 15 Apr 2006 13:26:57 -0400 (EDT) CC: Tom Lane , Richard Huxton , pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200604/11 X-Sequence-Number: 3510 Jeff Frost wrote: > On Sat, 15 Apr 2006, Tom Lane wrote: > > > For a command-line solution it's probably sufficient to sort by mtime, > > ie > > ls -t | head -1 > > A while back when I was trying to work this out on the admin list, I believe > we came up with the following: > > ls -tp /pg_xlog/ | grep -v "backup\|/" | head -1 > > which seems to work fairly well. Looks like that thread is here: > > http://archives.postgresql.org/pgsql-admin/2005-10/msg00173.php What does the -p and \| pipe check do? We don't have named pipes in that directory, do we? Also, what happens if the log switch happens, and some data change is written to the new WAL file in the first second, but nothing happens to the database after that for a minute? Your test would still show the old log file. -- Bruce Momjian http://candle.pha.pa.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +