Subject: Data comparison

From: Harish Harish <[email-masked]>
Date: Mon, 12 Aug 2024 16:11:42 +0530

Dear Admins

Is there any way to do data comparison for the database scheme in
PostgreSQL between old version(10) and new version (15.0).

Just migrated database from version 10 to 15.

Much appreciate your help.

Regards,
Hari

---

From: Muhammad Usman Khan <[email-masked]>
Date: Mon, 12 Aug 2024 15:48:11 +0500

Dear Harish,
If you are referring to data validation then the following query might give
you the desired results

/pg_dump -U postgres -s target -p 5334 > /tmp/db2_schema.sql ./pg_dump -U
postgres -s source > /tmp/db1_schema.sql diff /tmp/db1_schema.sql
/tmp/db2_schema.sql

Adjust your ports and databases name accordingly

Regards
Muhammad Usman Khan

---

From: Kashif Zeeshan <[email-masked]>
Date: Mon, 12 Aug 2024 16:17:01 +0500

Hi

You can also use pgAdmin for schema comparison, please check the below link.

https://www.pgadmin.org/docs/pgadmin4/8.8/schema_diff.html#:~:text=Click%20on%20Schema%20Diff%20under,click%20on%20the%20Compare%20button
.

Thanks
Kashif Zeeshan

On Mon, Aug 12, 2024 at 3:48 PM Muhammad Usman Khan <[email-masked]>
wrote:

> Dear Harish,
> If you are referring to data validation then the following query might
> give you the desired results
>

---

From: Mukesh Rajpurohit <[email-masked]>
Date: Mon, 12 Aug 2024 17:09:15 +0530

Hi Harish,
                      You can use EXCEPT operator for this purpose, i.e
(select * from source_table except select * from target_table;) and vice
versa. Thanks.

---

From: Wasim Devale <[email-masked]>
Date: Mon, 12 Aug 2024 17:14:28 +0530

also we can use pg_collector report

Thanks,
Wasim

On Mon, 12 Aug, 2024, 5:09 pm Mukesh Rajpurohit, <[email-masked]>
wrote:

>>> /pg_dump -U postgres -s target -p 5334 > /tmp/db2_schema.sql ./pg_dump
>>> -U postgres -s source > /tmp/db1_schema.sql diff /tmp/db1_schema.sql
>>> /tmp/db2_schema.sql
>>>

---

From: manish yadav <[email-masked]>
Date: Mon, 12 Aug 2024 11:57:29 +0000 (UTC)

Hi Harish,

You may explore Livecompare i.e. https://www.enterprisedb.com/docs/livecompare/latest/ to compare the data in two different instances.

Thanks and Regards,

Manish Yadav

On Monday, 12 August 2024, 05:09:54 PM IST, Mukesh Rajpurohit <[email-masked]> wrote: 

Hi Harish,
                      You can use EXCEPT operator for this purpose, i.e (select * from source_table except select * from target_table;) and vice versa. Thanks.

On Mon, Aug 12, 2024, 4:47 PM Kashif Zeeshan <[email-masked]> wrote:
> https://www.pgadmin.org/docs/pgadmin4/8.8/schema_diff.html#:~:text=Click%20on%20Schema%20Diff%20under,click%20on%20the%20Compare%20button.
> 
> Thanks
> Kashif Zeeshan
> 
> On Mon, Aug 12, 2024 at 3:48 PM Muhammad Usman Khan <[email-masked]> wrote:
>> Dear Harish,If you are referring to data validation then the following query might give you the desired results/pg_dump -U postgres -s target -p 5334 > /tmp/db2_schema.sql ./pg_dump -U postgres -s source > /tmp/db1_schema.sql diff /tmp/db1_schema.sql /tmp/db2_schema.sql
>> 
>> RegardsMuhammad Usman Khan
>> 
>> 
>> 
>>> Is there any way to do data comparison for the database scheme in PostgreSQL between old version(10) and new version (15.0).
>>>

---

From: Harish Harish <[email-masked]>
Date: Tue, 13 Aug 2024 10:37:36 +0530

Thank you very much everyone for your help.

Regards
Hari

On Mon, Aug 12, 2024 at 5:27 PM manish yadav <[email-masked]> wrote:

> Hi Harish,
>
> You may explore Livecompare i.e.
> https://www.enterprisedb.com/docs/livecompare/latest/ to compare the data
> in two different instances.
>
>
> Thanks and Regards,
>
> Manish Yadav
>
>
>
>
>
>
>
>
> >> Dear Harish,If you are referring to data validation then the following
> query might give you the desired results/pg_dump -U postgres -s target -p
> 5334 > /tmp/db2_schema.sql ./pg_dump -U postgres -s source >
> /tmp/db1_schema.sql diff /tmp/db1_schema.sql /tmp/db2_schema.sql
> >>