A summary of the RETURN SETOF variants
You learned that you can return table-like datasets from a function using one of the following:
RETURNS |
RECORD structure |
INSIDE function |
---|---|---|
|
This is obtained from the type definition |
DECLARE row variable of the ROW or RECORD type ASSIGN to row variable RETURN NEXT var; |
|
This is the same as the table or view structure | Â |
|
Dynamic using AS (name type, …) at call site |  |
|
This uses the |
RETURN NEXT ; |
|
This is declared inline, in parentheses, after the |
RETURN NEXT ; |