Why isn't there a pager and it doesn't show two records per page?
The code is wrong: Once you extend the query object, you need to save it, or it will get lost. The correct code is the following one.

$query = db_select('node', 'n');
$query = $query-&gt;condition('n.type', 'article', '=')
  -&gt;fields('n', array('nid', 'title', 'uid'))
  -&gt;extend('PagerDefault') 
  -&gt;limit(2);

$result = $query-&gt;execute();

foreach ($result as $node) {
  echo $node-&gt;title . "&lt;br/&gt;";
}


In my case, the result is the following one.


  Appellatio Fere Huic MetuoLudus Vereor


See the note shown on Extenders:


  Note that $query is not altered in place. The new object is returned from extend(), and if it is not saved to a variable it will be lost.