I think you'll have to RETURNS SET
or RETURNS TABLE
yourself.
Updated answer: using PL/pgSQL:
pg=> CREATE OR REPLACE FUNCTION string_to_rows(text) RETURNS SETOF TEXT AS $$
DECLARE
elems text[];
BEGIN
elems := string_to_array($1, ' ');
FOR i IN array_lower(elems, 1) .. array_upper(elems, 1) LOOP
RETURN NEXT elems[i];
END LOOP;
RETURN;
END
$$ LANGUAGE 'plpgsql';
CREATE FUNCTION
pg=> SELECT "Column" FROM string_to_rows('how now brown cow') d("Column");
Column
--------
how
now
brown
cow
(4 rows)
Original answer: using PL/perl:
pg=> CREATE LANGUAGE plperl;
CREATE LANGUAGE
pg=> CREATE FUNCTION psplit_to_rows(text) RETURNS SETOF TEXT AS $$
pg$> for my $t (split ' ', $_[0]) { return_next $t; }
pg$> undef;
pg$> $$ LANGUAGE plperl;
CREATE FUNCTION
pg=> SELECT "Column" FROM psplit_to_rows('how now brown cow') d("Column");
Column
--------
how
now
brown
cow
(4 rows)
Obviously you can extend this to handle a delimiter of your choosing, etc. (Note, I'm not sure if you really wanted that column named "Column", requiring identifier quoting to avoid keyword clash, but, there you are.)