Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 399D22E2EB0 for ; Wed, 26 Dec 2007 16:20:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 74010-03 for ; Wed, 26 Dec 2007 16:20:12 -0400 (AST) Received: from web31804.mail.mud.yahoo.com (web31804.mail.mud.yahoo.com [68.142.207.67]) by postgresql.org (Postfix) with SMTP id 9AE3D2E2E61 for ; Wed, 26 Dec 2007 16:20:15 -0400 (AST) Received: (qmail 11829 invoked by uid 60001); 26 Dec 2007 20:20:14 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=RmVgPu/y5lm8zmlQ0UMukctFObr/rN03YOb04YHvD6VTlddfh7hJ90eFB32nGWUBKS98hoeeisB5zIrHKsRdrbkhJOQ9jgfCivvjCbp1dVzP2YgrsrR/JGzxBe/HCgho8vNGfACTBkETFqGG/r/NRRziuXYfAHNECXs0kaS9ybI=; X-YMail-OSG: tUpuC_8VM1k7.6pr.ZlfNt3Q_0IfJWYB7.uSLRXTy9a49mfybJDPsmCEvHP4Xsp8.qVucw-- Received: from [12.180.237.138] by web31804.mail.mud.yahoo.com via HTTP; Wed, 26 Dec 2007 12:20:13 PST X-Mailer: YahooMailWebService/0.7.162 Date: Wed, 26 Dec 2007 12:20:13 -0800 (PST) From: Richard Broersma Jr Subject: Re: Advice for generalizing trigger functions To: chester c young Cc: sql pgsql In-Reply-To: <918856.33390.qm@web54301.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <321939.8466.qm@web31804.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/135 X-Sequence-Number: 29827 --- On Wed, 12/26/07, chester c young wrote: > what I do for change log is to have one change log table with table_id > and column_id attributes that refer by to my internal meta_table and > meta_column tables. this always works and is in the end, I have found, > a bit more flexible, allowing you to search for changed columns, for > example. I agree that EAV history tables are far more flexible than creating separate history tables for each base table. Especially since this design choice does not require modifications when tables are created, altered, or dropped. However, I was looking to utilize functionality that an EAV history table can't provide. For example, I replace joins to the Project.Managers table with joins to the History.Managers table and with a timestamp of interest to reproduce query results of the database's state that existed in "times passed". If I didn't need to regularly provide this functionality, I would certainly use an EAV history table. Regards, Richard Broersma Jr.