user_id is a sequence number for users.id in the users table.  there is no shares.username.

should be:
 left join users on users.id = shares.user_id

IIRC... from the old wiki: http://eligius.st/wiki/index.php/PostgreSQL_Schema