Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 7D59C4A2A3D for ; Sat, 25 Feb 2012 19:56:01 -0400 (AST) Received: from oproxy4-pub.bluehost.com ([69.89.21.11]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1S1RT5-0002jJ-NA for pgsql-hackers@postgresql.org; Sat, 25 Feb 2012 23:56:00 +0000 Received: (qmail 26660 invoked by uid 0); 25 Feb 2012 23:55:46 -0000 Received: from unknown (HELO host159.hostmonster.com) (74.220.207.159) by cpoproxy1.bluehost.com with SMTP; 25 Feb 2012 23:55:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=timbira.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=/B2Oq+Uke+RoGFKLdMJUrWyvuWB960SIymQ++EuNKrY=; b=uluiz5Bljl93LDc37pQdIdulgvRyWZZL88wZivsHEkXGer0r0q9N3r6W9E2zxqgxzNS3O46VFZYxBzpUu0NAqfZik3fjIIvMTrLjpLAXPs+W1TtuSRIyCnlR4i58Ig7u; Received: from [200.96.147.16] (helo=[10.3.2.6]) by host159.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1S1RSr-0001PB-Aj; Sat, 25 Feb 2012 16:55:46 -0700 Message-ID: <4F49746F.2000706@timbira.com> Date: Sat, 25 Feb 2012 20:53:19 -0300 From: Euler Taveira de Oliveira User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 MIME-Version: 1.0 To: Magnus Hagander CC: Fujii Masao , Tom Lane , Robert Haas , Pgsql Hackers Subject: Re: xlog location arithmetic References: <4EDD97E5.8080201@timbira.com> <4EDE5853.3080808@timbira.com> <4EF088E2.3090607@timbira.com> <18871.1324652754@sss.pgh.pa.us> <4F1AE435.50000@timbira.com> <4F315F6C.8030700@timbira.com> <4F3441FE.1020008@timbira.com> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1651:host159.hostmonster.com:timbirac:timbira.com} {sentby:smtp auth 200.96.147.16 authed with euler@timbira.com} X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/1229 X-Sequence-Number: 203593 On 25-02-2012 09:23, Magnus Hagander wrote: > Do we even *need* the validate_xlog_location() function? If we just > remove those calls, won't we still catch all the incorrectly formatted > ones in the errors of the sscanf() calls? Or am I too deep into > weekend-mode and missing something obvious? > sscanf() is too fragile for input sanity check. Try pg_xlog_location_diff('12/3', '-10/0'), for example. I won't object removing that function if you protect xlog location input from silly users. -- Euler Taveira de Oliveira - Timbira http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento