X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 30D4711F661B for ; Sat, 15 Apr 2006 14:56:45 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.126 X-Spam-Level: X-Spam-Status: No, score=0.126 required=5 tests=[AWL=0.126] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id qHHgruKk30yo for ; Sat, 15 Apr 2006 14:56:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6D8D111F6240 for ; Sat, 15 Apr 2006 14:56:42 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3FHuWas020246; Sat, 15 Apr 2006 13:56:32 -0400 (EDT) To: Jeff Frost cc: Bruce Momjian , Richard Huxton , pgsql-docs@postgresql.org Subject: Re: Proposed doc-patch: Identifying the Current WAL file In-reply-to: References: <200604151726.k3FHQvI01801@candle.pha.pa.us> Comments: In-reply-to Jeff Frost message dated "Sat, 15 Apr 2006 10:47:12 -0700" Date: Sat, 15 Apr 2006 13:56:32 -0400 Message-ID: <20245.1145123792@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/13 X-Sequence-Number: 3512 Jeff Frost writes: >>> ls -tp /pg_xlog/ | grep -v "backup\|/" | head -1 >> >> What does the -p and \| pipe check do? We don't have named pipes in >> that directory, do we? > The -p shows forward slashes after directories and the \| acts as an or and > the / following that just lets us filter directories out. This seems both overly cute and wrong, because it fails to filter plain files that might have a new mtime but aren't WAL files. I'd suggest a simple test on file name to make sure it looks like a WAL file, ie, 24 hex digits. ls -t .../pg_xlog | grep '^[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]$' | head -1 regards, tom lane