Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples
От | David Rowley |
---|---|
Тема | Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples |
Дата | |
Msg-id | CAKJS1f-4nND6JqmqxrW_NoVtLEGs7pwv381=hK+5knic4ER+CA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: COPY FROM WITH HEADER skips a tuple every 4 billion tuples (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
On 23 May 2018 at 09:31, Andres Freund <andres@anarazel.de> wrote: >> On 23 May 2018 at 03:55, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> > Hm, so why is the correct rowcount returned --- are we running >> > a separate counter for that purpose, and if so why? >> >> I thought the output I pasted was clearly showing it not to be the >> same. 4299999999 vs 4300000000. >> >> Did I misunderstand you? > > 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. *moment of realisation* Oh, this makes sense now. They can't be the same. One tracks the line number in the COPY FROM input, the other tracks the number of rows inserted. You'd only have to add a BEFORE INSERT ROW trigger which blocks some rows to understand why they need to be separate. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: