Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples - Mailing list pgsql-hackers

From Tom Lane
Subject Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples
Date
Msg-id 23464.1527026763@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plperl fails with perl 5.28
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] (Windows) psql echoes password when reading from pipe