Re: How to compare the results of two queries?

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: How to compare the results of two queries?
Дата
Msg-id CAKoxK+5+uBgQjSXMEG+z6hsU41tvjR607o0ArvqrL0_U_Quf_g@mail.gmail.com
обсуждение исходный текст
Ответ на How to compare the results of two queries?  (Juan Daniel Santana Rodés<jdsantana@estudiantes.uci.cu>)
Список pgsql-general
On Tue, Sep 17, 2013 at 4:59 PM, Juan Daniel Santana Rodés
<jdsantana@estudiantes.uci.cu> wrote:

> For example the execution of the function would be something like ...
>
> select compare('select * from table1', 'select * from table2');
>
> For this case the result is false, then the queries are executed on
> different tables.

I suppose you are taking for sure that both queries references tables
with the same structure, in such case why not computing an hash of
each row to check against the other result set?
About how many rows are we talking? Because it sounds to me like a
good job for a diff-like external tool, is this a possible solution?
Have you considered that the tables could have a different structure
or even just a different layout, in such case a "select *" will return
different results while the data is actually the same?
What is the aim of this?

Luca


В списке pgsql-general по дате отправления:

Предыдущее
От: Igor Neyman
Дата:
Сообщение: Re: How to compare the results of two queries?
Следующее
От: Giuseppe Broccolo
Дата:
Сообщение: Re: remove everything before the period