Insert result does not match record count - Mailing list pgsql-general

From Natalie Wenz
Subject Insert result does not match record count
Date
Msg-id EE352A4C-561A-49B3-82F5-C7C7FB068AA9@ebureau.com
Whole thread Raw
Responses Re: Insert result does not match record count
Re: Insert result does not match record count
List pgsql-general
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

select count(*) from oldtable where proc_date >= x and proc_date < y;

   count
-----------
 4373518938


So, my counts from the old and new tables match, but the result returned from the insert statement is sometimes a
completelydifferent number. (But not always.) I've checked my date ranges very carefully to make sure they match.  

Has anyone else ever seen this before? Should I be concerned?


Thanks,
Natalie

pgsql-general by date:

Previous
From: bricklen
Date:
Subject: Re: Reply: Can we specify transaction level when connectting toexternal postgresql server via postgres_fdw
Next
From: Tom Lane
Date:
Subject: Re: Insert result does not match record count