Re: Insert result does not match record count

From: Natalie Wenz <nataliewenz(at)ebureau(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Insert result does not match record count
Date: 2013-07-22 21:47:21
Message-ID: 546778B8-9164-4EB8-9150-3B32CA8B8A0E@ebureau.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I had just started to wonder if it was something that when you responded. I checked, and every case that I had where the numbers were wonky checked out when I subtracted 2^32. Whew!

Thanks, Jeff!

On Jul 22, 2013, at 11:20 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

> On Fri, Jul 19, 2013 at 3:20 PM, Natalie Wenz <nataliewenz(at)ebureau(dot)com> wrote:
>> Hi all,
>>
>> I am moving some data from one table to another in 9.2.4, and keep seeing this strange scenario:
>>
>> insert into newtable select data from oldtable where proc_date >= x and proc_date < y;
>>
>> INSERT 0 78551642
>>
>> select count(*) from newtable where proc_date >= x and proc_date < y;
>> count
>> -----------
>> 4373518938
>
> It looks to me like the status report is 32 bits and overflowed.
>
> 4,373,518,938 - 2^32 = 78,551,642
>
> Cheers,
>
> Jeff
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Amit Langote 2013-07-23 04:11:45 maintenance_work_mem and CREATE INDEX time
Previous Message Igor Neyman 2013-07-22 18:54:31 Re: Different transaction log for database/schema

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-07-22 22:01:50 Re: [COMMITTERS] pgsql: Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.
Previous Message Dimitri Fontaine 2013-07-22 21:44:59 Re: proposal - psql - show longest tables