Re: History

From: Alan Gutierrez <ajglist(at)izzy(dot)net>
To: Peter Childs <blue(dot)dragon(at)blueyonder(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: History
Date: 2003-02-02 00:47:05
Message-ID: 200302011847.05686.ajglist@izzy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 31 January 2003 05:27, you wrote:

> Should I use inherrtance and have a different table for each table I
> want history for or one table for the lot?

> Table "public.history"
> Column | Type | Modifiers
> ---------+-----------------------------+-----------
> tab | text |
> field | text |
> action | text |
> before | text |
> after | text |
> occured | timestamp without time zone |
> key | text |
> who | text |
> Indexes: history_tab btree (tab),
> history_tab_field btree (tab, field),
> history_tab_key btree (tab, "key"),
> history_who btree (who)

One table for the lot. If you use inheritance, it is my understanding
that it will be the same thing, since all the data will be stored in the
base table. The only thing you'd remove is the table name.

Also, you don't need indices on both (tab) and (tab, field), the
optimizer will happily use the latter, as it would the former.

--
Alan Gutierrez - ajglist(at)izzy(dot)net
http://khtml-win32.sourceforge.net/ - KHTML on Windows

In response to

  • History at 2003-01-31 11:27:43 from Peter Childs

Responses

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2003-02-02 04:33:26 Re: [NOVICE] Perl - Postgres
Previous Message news.verizon.net 2003-02-02 00:05:55 Re: Problem starting a session