Re: How to find the latest (partial) WAL file

From: "Just Someone" <just(dot)some(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find the latest (partial) WAL file
Date: 2006-04-11 00:10:20
Message-ID: 36932f270604101710t7a401676ue118a3d11e8a9060@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,

> If you sort first by mtime and second by file name you should find the
> right one in all cases, ie, take the latest mtime among the
> properly-named files, breaking ties by taking the higher filename.
>
> It'd probably be better if we had a function to report this, but
> you can get along without one.

For now I'm using ls with grep:
LAST_WAL=$(/bin/ls -t1p $WAL_DIR | /bin/grep -v / | /bin/grep -v
backup | /usr/bin/head -1)

But a pg function for that would be great.

Regards,

Guy Naor.

--
Family management on rails: http://www.famundo.com - coming soon!
My development related blog: http://devblog.famundo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wei Wei 2006-04-11 00:32:54 Re: Date & Time with time zone
Previous Message Tom Lane 2006-04-11 00:04:23 Re: Workaround for custom aggregate which would need "internal" as statetype