On 2018-05-22 11:55:26 -0400, Tom Lane wrote: > David Rowley <david.row...@2ndquadrant.com> writes: > > while it might not look too scary by itself, it gets a bit more so > > when you learn that the cur_lineno is only 32 bits wide. This will > > result in skipping a tuple every time the 32-bit variable wraps back > > around to 0 again. > > Hm, so why is the correct rowcount returned --- are we running > a separate counter for that purpose, and if so why?
Yes, it's a local counter in CopyFrom/CopyTo. It's probably not entirely trivial to unify the two. The batching etc makes us modify cur_lineno in a bit weird ways at times. It's noteworthy that the comment for cur_lineno says: /* line number for error messages */ Greetings, Andres Freund