insert new term as tag on node submit
It looks like you're using code from Drupal 6 in your first example, but from your second you must be using Drupal 7...$node-&gt;taxonomy isn't used in Drupal 7, taxonomy terms are related to entities via fields instead.

Your second example isn't working because the taxonomy_index table is just an index table relating nodes to terms...the hard-link between those two entities is actually contained in the field reference, which you haven't updated.

If I could offer a different approach, it would be to use hook_node_presave(). Using that method you can simply add another term id to the list of selected terms from the form, and rely on the node/field API to commit the changes and update the cache on your behalf.

function MYMODULE_node_presave($node) {
  $term_id = 73;

  // In reality you'd want to loop through the existing field values and check to 
  // avoid duplicates; this is just an example to actually set the value.
  if ($node-&gt;type == 'mytype') {
    $node-&gt;field_term_reference_field_name[$node-&gt;language][] = array('tid' =&gt; $term_id);
  }
}


As an added benefit this will also work for any nodes that you add programatically, not just those added/edited through the node form.