Re: How to find the latest (partial) WAL file - Mailing list pgsql-general

From Just Someone
Subject Re: How to find the latest (partial) WAL file
Date
Msg-id 36932f270604101710t7a401676ue118a3d11e8a9060@mail.gmail.com
Whole thread Raw
In response to Re: How to find the latest (partial) WAL file  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Workaround for custom aggregate which would need "internal" as statetype
Next
From: "Wei Wei"
Date:
Subject: Re: Date & Time with time zone