Re: pg_basebackup failed to back up large file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup failed to back up large file
Date: 2014-06-03 14:40:55
Message-ID: 12852.1401806455@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-06-03 23:19:37 +0900, Fujii Masao wrote:
>> - if (sscanf(copybuf + 124, "%11o", &current_len_left) != 1)
>> + if (sscanf(copybuf + 124, "%11lo", &current_len_left) != 1)

> That's probably not going to work on 32bit platforms or windows where
> you might need to use ll instead of l as a prefix. Also notice that
> apparently (c.f. 9d7ded0f4277f5c0063eca8e871a34e2355a8371) sscanf can't
> reliably be used for 64bit input :(. That pretty much sucks...

There's a far bigger problem there, which is if we're afraid that
current_len_left might exceed 4GB then what is it exactly that guarantees
it'll fit in an 11-digit field?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-06-03 14:46:54 strtoll/strtoull emulation
Previous Message Tom Lane 2014-06-03 14:37:53 Re: [HACKERS] BUG #9652: inet types don't support min/max