Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples
Date: 2018-05-22 22:06:03
Message-ID: 23464.1527026763@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2018-05-23 09:04:35 +1200, David Rowley wrote:
>> I thought the output I pasted was clearly showing it not to be the
>> same. 4299999999 vs 4300000000.

> Well, the row-returned counter is obviously wide enough, otherwise
> 4299999999 couldn't be returned. Tom's point, as I understood it, is
> that we obviously have one wide enough counter - why can't we reuse that
> for the one you made wider. And it doesn't seem entirely trivial to do
> so, so your patch is easier.

Right. Obviously there was a 64-bit counter someplace, but it wasn't
being used for this purpose.

I think after looking at the code that the cur_lineno counter is
counting input *lines* whereas the other thing counts finished *rows*,
so unifying them would be a bad idea anyway.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-22 22:14:13 Re: [PATCH] (Windows) psql echoes password when reading from pipe
Previous Message Paolo Crosato 2018-05-22 22:04:26 Re: Error on vacuum: xmin before relfrozenxid