Basic trigger in PL/pgSQL, to flip a boolean field if another field has text
Your trigger function can be improved:

CREATE OR REPLACE FUNCTION trg_insup_bef_recipe()
  RETURNS TRIGGER AS
$func$
BEGIN
IF TG_TABLE_NAME = 'recipe_' THEN
   IF TG_OP IN ('INSERT', 'UPDATE') THEN
      NEW.is_baked_   := NEW.baking_instructions_ &lt;&gt; '';
      NEW.is_roasted_ := NEW.roasting_instructions_ &lt;&gt; '';
   END IF;
   RETURN NEW;
ELSE
    RAISE EXCEPTION 'This trigger is being used on the wrong table.';
END IF;
END
$func$ LANGUAGE plpgsql;


Major points


Do not use a separate code block without need. Removed the spurious BEGIN .. END.
NEW.baking_instructions_ &lt;&gt; '' is a 100% identical drop-in replacement for
length( NEW.baking_instructions_ ) &gt; 0. Just shorter and faster.
The plpgsql assignment operator is :=, not =.
Removed multiple parentheses to demonstrate they are just noise.


Simplify

Given the trigger definition in your answer (which should be in your question), you can further simplify the trigger function.


If your trigger function is not intended to be generic but for a certain trigger on a certain table (which is the normal case) I suggest to reflect that in the function name instead of adding code and error messages to the function body. Much cheaper and cleaner (IMHO), but that's a matter of taste and style:




CREATE OR REPLACE FUNCTION trg_insup_bef_recipe()
  RETURNS TRIGGER AS
$func$
BEGIN
NEW.is_baked_   := NEW.baking_instructions_ &lt;&gt; '';
NEW.is_roasted_ := NEW.roasting_instructions_ &lt;&gt; '';
END
$func$ LANGUAGE plpgsql;


And since this trigger only has work to do when any of the involved columns have been changed, you only need to trigger it in those cases:

CREATE TRIGGER insup_bef_recipe
BEFORE INSERT
OR UPDATE OF is_baked_, baking_instructions_, is_roasted_, roasting_instructions_
ON recipe_
FOR EACH ROW EXECUTE PROCEDURE trg_insup_bef_recipe();

Simplify further

Do you really need those flags materialized as additional columns? Could be completely (and more reliably) replaced with simple expressions in your queries:

baking_instructions_ &lt;&gt; '' AS is_baked_


Then you don't need a trigger at all. You could create a view with that expression. Or even "generated field". Detailed instructions:
Store common query as column?
Computed / calculated columns in PostgreSQL