Re: [GENERAL] Insert result does not match record count

From: mark <dvlhntr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Natalie Wenz <nataliewenz(at)ebureau(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Insert result does not match record count
Date: 2015-05-04 23:35:37
Message-ID: CAKD=pjjm4avxOUox6nk-9y=s=KU_6V1Yy_HA=AiQC4bOSFDrVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Did this every go any further?

I wrote some data transformation script at work, and after seeing "with
count -2017657667" (and similar) in my scripts log I got a bit worried.
seeing else where were folks just run a full on count(*) later to check
counts but that is even MORE time and I was thinking it was a psycopg2
problem, but seems there are issues with the internal counters in pg as
well for tracking "large" changes.

thanks,

Mark

On Sun, Feb 2, 2014 at 9:12 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Vik Fearing <vik(dot)fearing(at)dalibo(dot)com> writes:
> > Without re-doing the work, my IRC logs show that I was bothered by this
> > in src/backend/tcop/postgres.c:
>
> > max_rows = pq_getmsgint(&input_message, 4);
>
> > I needed to change max_rows to int64 which meant I had to change
> > pq_getmsgint to pq_getmsgint64 which made me a little worried.
>
> As well you should be, because we are *not* doing that. That would be
> a guaranteed-incompatible protocol change. Fortunately, I don't see
> any functional need for widening the row-limit field in execute messages;
> how likely is it that someone wants to fetch exactly 3 billion rows?
> The practical use-cases for nonzero row limits generally involve fetching
> a bufferload worth of data at a time, so that the restriction to getting
> no more than INT_MAX rows at once is several orders of magnitude away
> from being a problem.
>
> The same goes for internal uses of row limits, which makes it
> questionable whether it's worth changing the width of ExecutorRun's
> count parameter, which is what I assume you were on about here. But
> in any case, if we did that we'd not try to reflect it as far as here,
> because the message format specs can't change.
>
> regards, tom lane
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan de Visser 2015-05-04 23:35:38 Re: plpgsql functions organisation
Previous Message Nanker Phelge 2015-05-04 22:06:06 Re: Errors using JDBC batchUpdate with plpgsql function

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-05-05 00:05:46 Re: Auditing extension for PostgreSQL (Take 2)
Previous Message Peter Geoghegan 2015-05-04 22:54:58 Re: INSERT ... ON CONFLICT syntax issues