pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: gitqueries0@gmail.com
Subject: BUG #18084: Count Mismatch Challenges During PostgreSQL Database Migration: Causes and Solutions
Date: Mon, 04 Sep 2023 17:55:51 +0000
Message-ID: <18084-f96f8e0e21fc3bea@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18084
Logged by:          Git Queries
Email address:      gitqueries0@gmail.com
PostgreSQL version: Unsupported/Unknown
Operating system:   Microsoft Windows Server 2019 Standard
Description:        

Version - PostgreSQL 10.20, compiled by Visual C++ build 1800, 64-bit

Platform - Windows

Regarding PostgreSQL, during the migration from PG 10.20 to 14.7, we will
perform a sanity check on the migrated tables using source and destination
row counts. Occasionally, we encounter count mismatches where the source
database has fewer rows, resulting in a higher count, or more rows,
resulting in a lower count.

Note: There are no migration issues, as all data rows have been successfully
migrated without data loss.

ProdDB=> select count(*) from PdtDetailsTable;
  count
---------
 1297324
(1 row)


ProdDB=> reindex table PdtDetailsTable;
REINDEX
ProdDB=> select count(*) from PdtDetailsTable;
  count
---------
 1297322
(1 row)


ProdDB=>
Upon reindexing, the count(*) query returns the correct results in the
source DB.

In the pg_log, we couldn't find any traces related to this behavior. Is
there a reason for such behavior, and how can this be addressed to prevent
future issues?



view thread (8+ messages)  latest in thread

Message-ID: <18084-f96f8e0e21fc3bea@postgresql.org>
Permalink:  ../18084-f96f8e0e21fc3bea@postgresql.org/
Also on:    postgresql.org/message-id/18084-f96f8e0e21fc3bea@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, gitqueries0@gmail.com
  Subject: Re: BUG #18084: Count Mismatch Challenges During PostgreSQL Database Migration: Causes and Solutions
  In-Reply-To: <18084-f96f8e0e21fc3bea@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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