... IF ( (SELECT count(*) FROM MI_TABLA WHERE MI_TABLA_ID=NEW.MI_TABLA_ID) != 0 ) THEN RAISE NOTICE ' SIN REGISTROS'; END IF;