Functions returning a table (or setof) should be used in the FROM clause:
select *
from brand_hierarchy(1234)
More Related Contents:
- Refactor a PL/pgSQL function to return the output of various SELECT queries
- Is SELECT or INSERT in a function prone to race conditions?
- Difference between language sql and language plpgsql in PostgreSQL functions
- How to return result of a SELECT inside a function in PostgreSQL?
- Pass multiple values in single parameter
- GROUP BY and aggregate sequential numeric values
- PL/pgSQL checking if a row exists
- PostgreSQL parameterized Order By / Limit in table function
- Return multiple fields as a record in PostgreSQL with PL/pgSQL
- PostgreSQL IF statement
- Call a set-returning function with an array argument multiple times
- Record returned from function has columns concatenated
- Postgres Dynamic Query Function
- Return setof record (virtual table) from function
- Window Functions or Common Table Expressions: count previous rows within range
- DROP FUNCTION without knowing the number/type of parameters?
- Postgres function returning table not returning data in columns
- COPY with dynamic file name
- pseudo_encrypt() function in plpgsql that takes bigint
- How to perform a select query in a DO block?
- Function with SQL query has no destination for result data
- Postgres trigger after insert accessing NEW
- Optimize GROUP BY query to retrieve latest row per user
- Check if value exists in Postgres array
- What is the difference between single quotes and double quotes in PostgreSQL?
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- Best way to count rows by arbitrary time intervals
- Reference alias in WHERE clause
- Continuing a transaction after primary key violation error
- postgres – where in (list) – column does not exist