From: | Ivan Voras <ivoras(at)freebsd(dot)org> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Simple row serialization? |
Date: | 2008-01-26 20:21:11 |
Message-ID: | fng4np$pk7$1@ger.gmane.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Adam Rich wrote:
>> I'd like to implement some simple data logging via triggers on a small
>> number of infrequently updated tables and I'm wondering if there are
>> some helpful functions, plugins or idioms that would serialize a row
>
>
> If you're familiar with perl, you can try PL/Perl.
Thanks, but another solution has been suggested to me, much simpler:
create or replace function data_log() returns trigger as $$
declare
sdata text;
begin
sdata = new;
insert into log(data) values (sdata);
return NULL;
end;
$$ language plpgsql;
create trigger data_insert after insert on data
for each row execute procedure data_log();
(from idea by Tom Lane)
From | Date | Subject | |
---|---|---|---|
Next Message | Sushant Sinha | 2008-01-27 04:56:39 | tsearch2: stop words and stemming separate? |
Previous Message | Adam Rich | 2008-01-26 20:14:17 | Re: Simple row serialization? |