How to refer to individual columns of a record returned by a function?
The problem, I guess, hits everyone starting with PostgreSQL.  Fortunately, the solution is rather easy: simply call

SELECT * FROM circular_ref();


instead of 

SELECT circular_ref();


This way it won't be a single record you get but a proper row.  This way, you can even do

SELECT id, path FROM circular_ref();


to get the columns you want.