Easiest way to compare the results of two queries row by row and column by column

From: Jason Long <mailing(dot)lists(at)octgsoftware(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Easiest way to compare the results of two queries row by row and column by column
Date: 2013-06-20 22:18:25
Message-ID: 1371766705.15253.44.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can someone suggest the easiest way to compare the results from two
queries to make sure they are identical?

I am rewriting a large number of views and I want to make sure that
nothing is changes in the results.

Something like

select compare_results('select * from v_old', 'select * from v_new');

I would want this to check that the row count and each row matched
column by column.

I am hoping someone has already written something for this...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-06-20 22:37:09 Re: Problem with left join when moving a column to another table
Previous Message Chris Angelico 2013-06-20 22:14:19 Re: coalesce function