Error when trying to extend a db_select query
addField returns the alias of the field that's added, not the query object. You just need to break your code up a bit:

$query = db_select('z_revision', 't')
  -&gt;fields('t', array('drupal_user_id'));

$query-&gt;addField('t', 'z', 'category');

$result = $query-&gt;extend('PagerDefault')
  -&gt;extend('TableSort')
  -&gt;orderByHeader($header)
  -&gt;limit(30)
  -&gt;execute();