Trigger calling a function HELP ME!
От | |
---|---|
Тема | Trigger calling a function HELP ME! |
Дата | |
Msg-id | 20040421144312.83625.qmail@web13909.mail.yahoo.com обсуждение исходный текст |
Список | pgsql-sql |
Hi all, first of all, let me explain what I'm trying to do. I have a table with a fairly complicated trigger. In this trigger I have a specific set of codelines that can be executed in more than 50 places that works on the new.* fields in order to fix/clean them. In order to improve readability, I created a function that manages this small set of codelines, but I'm stuck on the following error: --- ERROR: return type mismatch in function returning tuple at or near "imp_test_to_out_test" CONTEXT: compile of PL/pgSQL function "imp_test_trigger" near line 2 --- as a model, I've created this run-down example: --- CREATE TABLE public.imp_test ( id int8, value text ) WITHOUT OIDS; CREATE OR REPLACE FUNCTION public.imp_test_to_out_test(imp_test) RETURNS imp_test AS 'beginreturn new; end;' LANGUAGE 'plpgsql' STABLE; CREATE OR REPLACE FUNCTION public.imp_test_trigger() RETURNS trigger AS 'begin return imp_test_to_out_test(new); end;' LANGUAGE 'plpgsql' STABLE; CREATE TRIGGER imp_test_trigger_001 BEFORE INSERT OR UPDATE ON public.imp_test FOR EACH ROW EXECUTE PROCEDURE public.imp_test_trigger(); --- Whenever I run the following select, I get the a.m. result: --- insert into imp_test (id, value) values(1, 'A'); --- Can somebody help me? regards, ===== Riccardo G. Facchini
В списке pgsql-sql по дате отправления: