Re: Finding last checkpoint time

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Cc: PostgreSQL - General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: Finding last checkpoint time
Date: 2010-07-20 20:15:34
Message-ID: 4C4603E6.6010301@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Devrim GÜNDÜZ wrote:
> Is there a way to find last checkpoint time via SQL command? I know I
> can grep xlogs by turning on log_checkpoints, but I'd prefer an SQL
> solution.
>

Not directly. Best you can do without linking in new server code is
either import the logs via CVS to get them into a table, or shell out
and look at what comes out of pg_controldata.

There have been two works in progress to improve this situation that
didn't make it through to commit yet.
http://archives.postgresql.org/pgsql-patches/2008-04/msg00079.php tried
to expose just that bit of data and was shot down for a number of
reasons, from accuracy concerns to the UI used. The still pending one
at
http://archives.postgresql.org/message-id/4B959D7A.6010907@joeconway.com
just adds a SQL interface to what comes out of pg_controldata. You
might prefer to use something like that to calling the shell to parse
the output from the utility, if you don't mind adding something new to
the server code.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aleksey Tsalolikhin 2010-07-20 20:31:59 check_postgres reports most of my tables are unanalyzed for 8 weeks; why isn't autovacuum analyzing them?
Previous Message Thom Brown 2010-07-20 19:48:23 Re: Finding last checkpoint time