]> granicus.if.org Git - postgresql/commit
Widen COPY FROM's current-line-number counter from 32 to 64 bits.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 May 2018 17:32:52 +0000 (13:32 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 May 2018 17:32:52 +0000 (13:32 -0400)
commitc92d1461e10799c20e10582127dbbd6cb50e9de3
treebf6a37bfae4b6c7ff8f6d004184ff5385ef2ccb5
parentcf516dc9d69052360f1de390636c220797120d28
Widen COPY FROM's current-line-number counter from 32 to 64 bits.

Because the code for the HEADER option skips a line when this counter
is zero, a very long COPY FROM WITH HEADER operation would drop a line
every 2^32 lines.  A lesser but still unfortunate problem is that errors
would show a wrong input line number for errors occurring beyond the
2^31'st input line.  While such large input streams seemed impractical
when this code was first written, they're not any more.  Widening the
counter (and some associated variables) to uint64 should be enough to
prevent problems for the foreseeable future.

David Rowley

Discussion: https://postgr.es/m/CAKJS1f88yh-6wwEfO6QLEEvH3BEugOq2QX1TOja0vCauoynmOQ@mail.gmail.com
src/backend/commands/copy.c