how to use record type

Поиск
Список
Период
Сортировка
От Horst Herb
Тема how to use record type
Дата
Msg-id 01081500343310.01835@munin.gnumed.dhs.org
обсуждение исходный текст
Список pgsql-sql
Help please!

How do I actually insert the variables OLD or NEW or a record type into a 
table from within a trigger?

Like doing the following:

drop table th1;
create table th1(
id serial, 
text text );

drop table th_audit;
create table th1_audit(
ts timestamp default now()
) inherits(th1);

drop function thaudit();
create function thaudit() returns opaque as '
begin-- I want to insert OLD into th_audit - how do I do this???return NEW;
end; ' language 'plpgsql';

drop trigger ta on th1;
create trigger ta before delete or update on th1   for each row execute procedure thaudit();

Reagrds,
Horst


В списке pgsql-sql по дате отправления:

Предыдущее
От: Manuel Sugawara
Дата:
Сообщение: Re: Re: DateDiff, IsNull?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Eh?