Whole-row comparison ?

Поиск
Список
Период
Сортировка
От
Тема Whole-row comparison ?
Дата
Msg-id CCC9DCA122011F4CA593F6A548BFFBD354D217@esebe111.NOE.Nokia.com
обсуждение исходный текст
Ответы Re: Whole-row comparison ?  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-sql
Hi there,
 
I'm trying to implement a "versionned" storage for a datawarehouse system, meaning I have tables which store daily information about objects and I would like to have a row inserted (i.e. a new version) only if it differs from the most recent existing row.  For instance instead of storing
 
version    attribute1    attribute2
1            x                y
2            x                y
3            x                y
4            z                y
5            z                y
6            z                t
 
we would only keep the diffs :
 
version    attribute1    attribute2
1            x                y
4            z                y
6            z                t
 
This would save lots of space and the full table could be easily accessed through a view.
 
However as the tables have a large number of rows (several hundreds) I would like to avoid having to write conditions like WHERE (old.att1 != new.attr1 or old.attr2 != new.attr2 or ... or old.attr245 != new.attr245 )
 
So my question is: is there a way to do some kind of whole-row comparison ? For instance a hash of the full row or something similar ?  Is there a standard way of solving this problem ?
 
Thanks a lot for any hind !
Christian

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

Предыдущее
От: "Bart Degryse"
Дата:
Сообщение: Re: SQL Query Validate Records Multiple Tables - HelpNeeded
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Whole-row comparison ?