How to cast entity to set in PostgreSQL
问题 Using Postgres 9.3, I found out that I can perform something like this: SELECT generate_series(1,10); But I can't do this: SELECT (SELECT generate_series(1,10)); Can I somehow cast SELECT result to setof int to use it same as result from generate_series() ? What exactly is happening there why I can use result from function but not from SELECT ? 回答1: Your first form is a non-standard feature of Postgres. It allows SRF (Set Returning Functions) in the SELECT list, which are expanded to multiple