title: How to get the top most parent in PostgreSQL
body: <p>I have a tree structure table with columns:
  id,parent,name.
  Given a tree A->B->C,
  how could i get the most top parent A's ID according to C's ID?
  Especially how to write SQL with "with recursive"?
  Thanks!</p>