I was reading online about function on PostgreSQL and returns results In this links:
Functions returning a table (or setof) should be used in the FROM clause:
select * from brand_hierarchy(1234)