On Wed, Aug 3, 2016 at 5:48 AM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 12/9/15 9:07 AM, filip@jirsak.org wrote:
>> CREATE FUNCTION test_cursor_to_xml() RETURNS xml AS $$
>> DECLARE
>> curs CURSOR FOR SELECT generate_series(1, 5);
>> BEGIN
>> OPEN curs;
>> RETURN cursor_to_xml(curs, 10, TRUE, FALSE, '');
>> END;
>> $$ LANGUAGE plpgsql;
>>
>> SELECT test_cursor_to_xml();
>>
>>
>> This returns XML forrest instead of XML document with single root.
>
> You're right, this should have a <table>...</table> around it, like
> query_to_xml() does.
Then it would have to use the cursor name, not a table name, like this, right?
--
Thomas Munro
http://www.enterprisedb.com