pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: chester c young <chestercyoung@yahoo.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: Advice for generalizing trigger functions
Date: Wed, 26 Dec 2007 12:20:13 -0800 (PST)
Message-ID: <321939.8466.qm@web31804.mail.mud.yahoo.com> (raw)
In-Reply-To: <918856.33390.qm@web54301.mail.re2.yahoo.com>

--- On Wed, 12/26/07, chester c young <chestercyoung@yahoo.com> 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.



view thread (7+ messages)  latest in thread

Message-ID: <321939.8466.qm@web31804.mail.mud.yahoo.com>
Permalink:  ../321939.8466.qm@web31804.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/321939.8466.qm@web31804.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, chestercyoung@yahoo.com
  Subject: Re: Advice for generalizing trigger functions
  In-Reply-To: <321939.8466.qm@web31804.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox