Summary of RETURN SETOF variants
We learned that you can return table-like data sets from a function using one of the following:
RETURNS ... |
RECORD structure |
INSIDE function |
---|---|---|
|
From type definition |
DECLARE row variable of ROW or RECORD type ASSIGN to row variable RETURN NEXT var; |
|
Same as table or view structure | |
|
Dynamic, using AS (name type, …) at call site | |
|
Using RETURN NEXT ;
| |
|
Declared in-line in parentheses after RETURN NEXT ;
|