Postgresql: Return Unique Rows
select *
from the_table
where userid in (select userid
                 from the_table
                 group by userid
                 having count(*) = 1)


Alternatively:

select *
from the_table
   inner join (select userid
               from the_table
               group by userid
               having count(*) = 1) t on t.userid = the_table.userid;


or (possibly more efficient because only a single scan is needed):

select id, data, userid
from (
  select id, 
         data, 
         userid,
         count(*) over (partition by userid) as cnt
  from the_table
) t
where cnt = 1;