How to most efficiently find out if a record has child records?
Don't forget that Postgres has a boolean datatype. The following is the most succinct way to express the query:

select
  parent_id,
  name,
  exists (select from child where parent_id = p.parent_id) as has_children
from parent p;


https://dbfiddle.uk/?rdbms=postgres_10&amp;fiddle=86748ba18ba8c0f31f1b77a74230f67b