Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A09199FBD3C for ; Wed, 23 May 2007 21:33:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 16784-06 for ; Wed, 23 May 2007 21:32:53 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by postgresql.org (Postfix) with ESMTP id 7FA729FBD8B for ; Wed, 23 May 2007 21:32:58 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id f1so378906nzc for ; Wed, 23 May 2007 17:32:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=oHQr0Bxjh4mmHrldjZSYaIq0bnizTVqJH2HtNzIN7Gn09r9tDqWade1WmMWcOwf/XH99B0oUEqIGEwhybByLXkzUE5lapn4KtH4a6WTzzKPaAsLbKo5nvOa6s6td9xUSwi1fZgzt+FdytoJeLwNZ2EbEGVkIZtphCD+Dj+And14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=naGxeWj0AsIluDQHtWYOSmALaAHmMhJ9LiOeDbo5K3AjVWYI0Q/3UNWKiBSGlfgQzhAj8cCY/wQs9A6lxV6PUmQ/e0hrHyTAgvpUPO2DAyguLLy8WOHZiBhqaEdIppFUfZxPwjmaNLH3zOzh65u9BX6KVknw2/J3Q6lLjIuFO98= Received: by 10.114.53.1 with SMTP id b1mr562589waa.1179966776392; Wed, 23 May 2007 17:32:56 -0700 (PDT) Received: from ?10.1.1.11? ( [203.217.18.65]) by mx.google.com with ESMTP id a8sm1086046poa.2007.05.23.17.32.54; Wed, 23 May 2007 17:32:55 -0700 (PDT) Message-ID: <4654DD7C.3000103@gmail.com> Date: Thu, 24 May 2007 10:34:04 +1000 From: Chris User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Colin Ross CC: pgsql-php@postgresql.org Subject: Re: Application Design: Where to implement historical revisions of objects References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/8 X-Sequence-Number: 3797 Colin Ross wrote: > Summary: > In a situation where the business model dictates that a certain entity > or class of entities should support the viewing of and differencing of > historical revisions of the data (read properties) contained in the > entity should be supported. Should the logic for the creation and > viewing of this historical information be implemented in the application > itself If you are only going to be using postgres, do it with a trigger so you don't have to remember to do it in the application (it's quite easy to forget something like this). If you have to support other databases as well, then make sure they support triggers. If you have to use a database that doesn't support triggers, then that makes the decision for you (eg supporting mysql 4.1). If you have to do it in the app, it's still quite easy: insert into history_table (...) select x,y,z from orig_table where id='X' Done :) -- Postgresql & php tutorials http://www.designmagick.com/