Robert Haas wrote:
> Tom's recent work to fix the (TG_OP = 'INSERT' and NEW.foo ...)
> problem reminded me of another PL/pgsql annoyance:
>
> create table foo (a integer);
> create or replace function broken() returns trigger as $$begin perform
> 1; end$$ language plpgsql;
> create trigger bar after insert on foo for each row execute procedure broken();
> insert into foo values (1);
> ERROR: control reached end of trigger procedure without RETURN
> CONTEXT: PL/pgSQL function "broken"
>
> Since the return value is ignored anyway, why do we have to complain
> if it's left out altogether? Granted, it's easy to work around, but
> still.
>
>
Isn't is a requirement of plpgsql that you not fall off the end of a
function unless it is declared to return void? The function doesn't know
if it will be called before or after.
cheers
andrew