Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 094FF9FB763 for ; Fri, 25 May 2007 15:07:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 07440-02 for ; Fri, 25 May 2007 15:07:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by postgresql.org (Postfix) with ESMTP id 7A4079FC247 for ; Fri, 25 May 2007 15:07:46 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c36so243981ana for ; Fri, 25 May 2007 11:07:24 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=LJzJ0zpE0l704vqYcMb4MHNAjNcN6osunBQVhlOSsHUVNx3hH+PymK7J/p0ZP84sl7VGgOAGJIT44QB5D/tTtNhLJ7Wv6nqnAfB8QdZImhyOePupkC4qc/5SG8emy5Mf+MvVc5CZdmOK7SuMvqIa+tA64Co2L0Ql86XKOukB2ng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=duJo7d5F6IMjIUWZrx7tcw+NzZXZH5LbE8r6lHGf+k0dk4hgEYvgDT+EYkfEPqyf0lMNOwk/MvIEmPr8HptUXFntxud391YitrdYd3GFCuOCi2Mwin+TuN3gkv22EP1uatNDWmfhOSQbc+pV9Z6YuVJljXAAELjO9Wb5KPMWTiQ= Received: by 10.100.153.17 with SMTP id a17mr2931076ane.1180116444583; Fri, 25 May 2007 11:07:24 -0700 (PDT) Received: by 10.100.110.1 with HTTP; Fri, 25 May 2007 11:07:24 -0700 (PDT) Message-ID: Date: Fri, 25 May 2007 11:07:24 -0700 From: "Colin Ross" To: "Michelle Konzack" Subject: Re: Application Design: Where to implement historical revisions of objects Cc: pgsql-php@postgresql.org In-Reply-To: <20070525174108.GA6097@freenet.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3849_4216922.1180116444453" References: <20070525174108.GA6097@freenet.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/10 X-Sequence-Number: 3799 ------=_Part_3849_4216922.1180116444453 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline But in the one-table holds all system, the Model Object need to know about it. i.e. "Select top 1 from data where serialnumber = 3821 order by revision desc" And off hand, it would make retrieving a whole data set of say- all the current data involve a subquery to find the most recent data revision for each serialnumber. I don't at all mean to discount the system, but I have yet to find a good pattern for dealing with multiple variants of the same datarow/set. Colin On 5/25/07, Michelle Konzack wrote: > > Hello Colin, > > Am 2007-05-23 13:10:42, schrieb Colin Ross: > > In Practice: > > An application has a model class of "PageContent" which represents the > > content that is shown on a certain page. Users of the system are > > authenticated, then able to edit the content. From an application design > > point > > of view, where should the logic and underlying system be for the > management > > of historical revisions. > > I have something similar, exactly, a Database of military data and data > sets are never modified but added. > > So, I give each dataset a serialnumber and a revision 0. Then if the > dataset was modified I change the revision to a higher number and add > the whole dataset into a new row. > > This thing is done using trigers. > > Greetings > Michelle Konzack > Systemadministrator > Tamay Dogan Network > Debian GNU/Linux Consultant > > > -- > Linux-User #280138 with the Linux Counter, http://counter.li.org/ > ##################### Debian GNU/Linux Consultant ##################### > Michelle Konzack Apt. 917 ICQ #328449886 > 50, rue de Soultz MSN LinuxMichi > 0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) > > ------=_Part_3849_4216922.1180116444453 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline But in the one-table holds all system, the Model Object need to know about it.
  i.e. "Select top 1 from data where serialnumber = 3821 order by revision desc"
And off hand, it would make retrieving a whole data set of say- all the current data involve a subquery to find the most recent data revision for each serialnumber.

I don't at all mean to discount the system, but I have yet to find a good pattern for dealing with multiple variants of the same datarow/set.

Colin

On 5/25/07, Michelle Konzack <linux4michelle@freenet.de> wrote:
Hello Colin,

Am 2007-05-23 13:10:42, schrieb Colin Ross:
> In Practice:
> An application has a model class of "PageContent" which represents the
> content that is shown on a certain page. Users of the system are
> authenticated, then able to edit the content. From an application design
> point
> of view, where should the logic and underlying system be for the management
> of historical revisions.

I have something similar, exactly, a Database of military data and data
sets are never modified but added.

So, I give each dataset a serialnumber and a revision 0. Then if the
dataset was modified I change the revision to a higher number and add
the whole dataset into a new row.

This thing is done using trigers.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


------=_Part_3849_4216922.1180116444453--