Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 973B31EC5BE6 for ; Thu, 2 Feb 2012 13:47:50 -0400 (AST) Received: from mimolette.dalibo.net ([212.85.154.222]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt0lB-0006Zr-Tm for pgsql-hackers@postgresql.org; Thu, 02 Feb 2012 17:47:50 +0000 Received: from [192.168.1.104] (AGrenoble-551-1-12-128.w92-133.abo.wanadoo.fr [92.133.243.128]) by mimolette.dalibo.net (Postfix) with ESMTPSA id 0135328C790 for ; Thu, 2 Feb 2012 18:47:35 +0100 (CET) Message-ID: <4F2ACC37.9030902@dalibo.com> Date: Thu, 02 Feb 2012 18:47:35 +0100 From: Gilles Darold User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: Patch pg_is_in_backup() References: <4F26E291.9020605@dalibo.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/95 X-Sequence-Number: 202460 Le 02/02/2012 12:23, Marti Raudsepp a =C3=A9crit : > On Mon, Jan 30, 2012 at 20:33, Gilles Darold = wrote: >> After some time searching for a Pg system administration function like >> pg_is_in_recovery(), let's say pg_is_in_backup(), I couldn't find one. >> The minor patch attached here adds this administrative function that c= an >> be used with others backup control functions. This is a very little >> patch outside documentation because the function is only a wrapper to >> the internal BackupInProgress() function, just like pg_is_in_recovery(= ) >> is calling RecoveryInProgress(). > I think it would be more useful to have a function that returns a > timestamp when the backup started. That way, it's possible to write a > generic monitoring script that alerts the sysadmin only when a backup > has been running for too long, but is silent for well-behaved backups. For now the internal function BackupInProgress() only return a boolean. I like the idea that pg_is_in_backup() just works as pg_is_in_recovery() do. I mean it doesn't return the timestamp of the recovery starting time but only true or false. Maybe we can have an other function that will return all information available in the backup_label file ? Regards, --=20 Gilles Darold http://dalibo.com - http://dalibo.org