I have a function which returns:
TABLE (id TEXT, collected TIMESTAMPTZ)
In another function, I would like to be able to pass the result of that first function as a parameter. For example:
CREATE FUNCTION my_func(devices TABLE(id TEXT, collected TIMESTAMPTZ)) ....
That syntax gives me an error:
ERROR: syntax error at or near "TABLE"
Is there some way to accomplish this in PostgreSQL?
Best Answer
OK, based on feedback from Erwin Brandstetter above, I came up with a VERY nice solution detailed below: