Re: xlog location arithmetic
Euler Taveira de Oliveira <euler@timbira.com>
From: Euler Taveira de Oliveira <euler@timbira.com>
To: Magnus Hagander <magnus@hagander.net>
Cc: Fujii Masao <masao.fujii@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2012-02-25T23:53:19Z
Lists: pgsql-hackers
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