Re: Dynamic Log tigger (plpgsql) - Mailing list pgsql-general

From Jim Nasby
Subject Re: Dynamic Log tigger (plpgsql)
Date
Msg-id 09B1FAEB-3361-4601-B3B7-A8B985EA7246@decibel.org
Whole thread Raw
In response to Dynamic Log tigger (plpgsql)  (Noah Heusser <noah@heussers.ch>)
List pgsql-general
On Jun 16, 2007, at 6:26 AM, Noah Heusser wrote:
> I want to implement a trigger-function witch can fill the following
> table.
> Each data manipulation (INSERT, UPDATE or DELETE) gets logged.
> The function should work as trigger on diffrent tables.
>
> CREATE TABLE logtable (
>  operation        CHAR(6) CHECK (change_type IN ('DELETE',
> 'INSERT', 'UPDATE')),

Note that that field will take 12 bytes in 8.2, and assuming that
varvarlena is in 8.3, 8 bytes there (or is varvarlena byte-aligned?)

You might be better going with "char" (with the double-quotes) and
'D', 'I', and 'U'.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



pgsql-general by date:

Previous
From: Tony Caduto
Date:
Subject: Re: Proposed Feature
Next
From: Jim Nasby
Date:
Subject: Re: A problem in inheritance