pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16434: some data lost
3+ messages / 3 participants
[nested] [flat]

* BUG #16434: some data lost
@ 2020-05-13 15:07  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: PG Bug reporting form @ 2020-05-13 15:07 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: davydenka@mail.ru

The following bug has been logged on the website:

Bug reference:      16434
Logged by:          Kos Dav
Email address:      davydenka@mail.ru
PostgreSQL version: 11.5
Operating system:   Ubuntu 11.5-3.pgdg18.04+1) on x86_64-pc-linux-gnu,
Description:        

i have parent table:
table
CREATE TABLE public.audit (
	id bigserial NOT NULL,
	... some fields....
	created_at timestamp NULL
);
and partitions for every month :
CREATE TABLE public.a202001 PARTITION OF public.audit    FOR VALUES FROM
('2020-01-01') TO ('2020-02-01');
CREATE TABLE public.a202002 PARTITION OF public.audit    FOR VALUES FROM
('2020-02-01') TO ('2020-03-01');
CREATE TABLE public.a202003 PARTITION OF public.audit    FOR VALUES FROM
('2020-03-01') TO ('2020-04-01')...
permissions on table only select, insert.
periodically i copy data from one partition table to foreign server via
fdw.
yesteday i copied data from patrition  a202003

insert into public.a202003_foreign select * from public.a202003;
INSERT 0 61140720   -- copied 61140720    rows

Today I double-checked the quantity
select count(*) from public.a202003;           -- result 60594707  
select count(*) from public.a202003_foreign;   -- result 61140720 -- all
copied rows
Part of data missing (from 2020/03/01 00:00 to 2020/03/01 17:35) in table
a202003.
 
destination table has all id in row -start 643096815, 643096816 ....
but source table has lost  part of data and id start from id 643642828...

how it is possible?  no errors in log file. system not restarted. uptime
since 2020-03-10 02:48:09



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re:BUG #16434: some data lost
@ 2020-05-14 08:13  Konstantin Davydenka <davydenka@mail.ru>
  0 siblings, 1 reply; 3+ messages in thread

From: Konstantin Davydenka @ 2020-05-14 08:13 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org


 
today i copied rows again;
insert into public.a202003_foreign_new  select * from public.a202003;
copied 61140720! 
select count(*) from a202003  ; return result 60594707!
but how?  why i cannot see some rows in old tables ?
run: vacuum(full) a202003 and i can see  all rows in source table…
I don't understand that... why  "insert into select" statement query can see all rows,
 but other select queries can not see all rows.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Re:BUG #16434: some data lost
@ 2020-05-14 13:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Konstantin Davydenka <davydenka@mail.ru>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2020-05-14 13:19 UTC (permalink / raw)
  To: Konstantin Davydenka <davydenka@mail.ru>; +Cc: pgsql-bugs@lists.postgresql.org

=?UTF-8?B?S29uc3RhbnRpbiBEYXZ5ZGVua2E=?= <davydenka@mail.ru> writes:
> I don't understand that... why  "insert into select" statement query can see all rows,
>  but other select queries can not see all rows.

I wonder if you have a corrupt index in there.  REINDEX should fix it if
so.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-05-14 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 15:07 BUG #16434: some data lost PG Bug reporting form <noreply@postgresql.org>
2020-05-14 08:13 Re:BUG #16434: some data lost Konstantin Davydenka <davydenka@mail.ru>
2020-05-14 13:19 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox