Re: [HACKERS] Insert result does not match record count - Mailing list pgsql-general

From Vik Fearing
Subject Re: [HACKERS] Insert result does not match record count
Date
Msg-id 51EFF67A.7020509@dalibo.com
Whole thread Raw
In response to Re: Insert result does not match record count  (Vik Fearing <vik.fearing@dalibo.com>)
Responses Re: [HACKERS] Insert result does not match record count
List pgsql-general
On 07/24/2013 04:04 PM, Vik Fearing wrote:
> On 07/22/2013 06:20 PM, Jeff Janes wrote:
>> On Fri, Jul 19, 2013 at 3:20 PM, Natalie Wenz <nataliewenz@ebureau.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
> Attached is a small patch that should fix the problem.

It would seem this was not as thorough as it should have been and
there's a lot more to do.  I'm working on a better patch.

Also worth mentioning is bug #7766.
http://www.postgresql.org/message-id/E1Tlli5-0007tR-HO@wrigleys.postgresql.org

Vik


pgsql-general by date:

Previous
From: Some Developer
Date:
Subject: Re: Why are stored procedures looked on so negatively?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Insert result does not match record count