Interaction Record (Journal Table?) - Mailing list pgsql-general

From Clark C . Evans
Subject Interaction Record (Journal Table?)
Date
Msg-id 20010826135759.A16703@doublegemini.com
Whole thread Raw
List pgsql-general
I was thinking that for the application I'm
working on, it'd be nice to have a journal
(as an XML fragment) which describes  the
interactions within the database...

    <insert table="person">
        <id>3493</id>
        <given>Clark</given>
        <family>Evans</family>
    </insert>
    <update table="person" id="3493">
       <middle>Cameron</middle>
    </update>
    <delete table="person" id=3493" />

I was wondering if anyone has done
something similar?  If so, what
approach did you use and is it
published as a reuseable module?

If not... how would you go about
approaching this?  I suppose it could
all fit in a "journal" table using
arrays?

JOURNAL has 6 columns:
    action, target_table, where_columns, where_values, columns, values

INSERT INTO JOURNAL VALUES ('insert','person'
    ,NULL,NULL,
    ['id','given','family'],[3493,'Clark','Evans']);
INSERT INTO JOURNAL VALUES ('update','person',
    ['id'], [3439],
    ['middle'],['Cameron']);
INSERT INTO JOURNAL VALUES ('delete','person',
    ['id'],[3439],
    NULL,NULL);

I guess this would be better in the spirit of
PostgreSQL... in this way one can easily make
the dump of the SQL above...

Thoughts?

Clark







pgsql-general by date:

Previous
From: "Denis A. Doroshenko"
Date:
Subject: Re: MySQL's (false?) claims... (was: Re: PL/java?)
Next
From: "Alex Knight"
Date:
Subject: Re: PL/java?