You can use:
SELECT (ST_IsValidDetail(the_value)).* FROM the_table;
... but unfortunately PostgreSQL actually executes the ST_IsValidDetail
function once for each row. As a workaround you can mangle the query a little more, materializing via a common table expression then extracting the tuples in a second pass:
WITH interim_result(v) AS (
SELECT ST_IsValidDetail(the_value) FROM the_table
)
SELECT (v).* FROM interim_result;
The parens around (v)
are required to tell the parser you're referring to a value, not to a table name.
Demo:
CREATE OR REPLACE FUNCTION multirows(x IN integer, a OUT integer, b OUT integer, c OUT integer) AS
$$
BEGIN
RAISE NOTICE 'multirows(%) invoked', x;
a := x;
b := x+1;
c := x+2;
RETURN;
END;
$$ LANGUAGE plpgsql;
craig=> SELECT multirows(x) FROM generate_series(1,2) x;
NOTICE: multirows(1) invoked
NOTICE: multirows(2) invoked
multirows
-----------
(1,2,3)
(2,3,4)
(2 rows)
craig=> SELECT (multirows(x)).* FROM generate_series(1,2) x;
NOTICE: multirows(1) invoked
NOTICE: multirows(1) invoked
NOTICE: multirows(1) invoked
NOTICE: multirows(2) invoked
NOTICE: multirows(2) invoked
NOTICE: multirows(2) invoked
a | b | c
---+---+---
1 | 2 | 3
2 | 3 | 4
(2 rows)
craig=> WITH interim(v) AS (SELECT multirows(x) FROM generate_series(1,2) x)
SELECT (v).* FROM interim;
NOTICE: multirows(1) invoked
NOTICE: multirows(2) invoked
a | b | c
---+---+---
1 | 2 | 3
2 | 3 | 4
(2 rows)