Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id D712E2E0046 for ; Thu, 22 Nov 2007 06:57:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 44667-06-2 for ; Thu, 22 Nov 2007 06:57:38 -0400 (AST) Received: from sn.sai.msu.ru (sn.sai.msu.ru [195.208.220.215]) by postgresql.org (Postfix) with ESMTP id A02A62E0039 for ; Thu, 22 Nov 2007 06:57:38 -0400 (AST) Received: from sn.sai.msu.ru (localhost [127.0.0.1]) by sn.sai.msu.ru (8.14.1/8.12.8) with ESMTP id lAMAvYRk018502; Thu, 22 Nov 2007 13:57:34 +0300 Received: from localhost (megera@localhost) by sn.sai.msu.ru (8.14.1/8.12.8/Submit) with ESMTP id lAMAvYsJ018499; Thu, 22 Nov 2007 13:57:34 +0300 X-Authentication-Warning: sn.sai.msu.ru: megera owned process doing -bs Date: Thu, 22 Nov 2007 13:57:34 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@sn.sai.msu.ru To: Reg Me Please cc: pgsql-general@postgresql.org Subject: Re: EAV or not to EAV? In-Reply-To: <200711220948.36142.regmeplease@gmail.com> Message-ID: References: <200711220948.36142.regmeplease@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/1196 X-Sequence-Number: 124192 On Thu, 22 Nov 2007, Reg Me Please wrote: > Hi all. > > I have to take into account the update history of every single > field into a number of tables. > Those updates can come to the future (next values) but also to the > past (history fix) and apply only to some fields, usually not to the > entire record. > Every lookup in those tables is always related to a timestamp that > normally is the current timestamp, but can also be a past timestamp. > > I've come up with a "traditionally regretted" EAV design with the add of > timestamps for the history. And the related problems, some of which have > been solved by Joe Conways's crosstab contrib. > > Is there a better idea than mine? I hope so. We use contrib/hstore for this Regards, Oleg _____________________________________________________________ Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru), Sternberg Astronomical Institute, Moscow University, Russia Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(495)939-16-83, +007(495)939-23-83