Search Postgresql Archives

Fetching from psql procedures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm looking for a way to build large xml documents based on a set of tables, hence using recursive queries.


something like:

  FOR rec1 IN ...
    FOR rec2 IN  ...
    
      RETURN QUERY select '<foo>
      FOR  rec3 IN  ...

        RETURN QUERY select (XMLELEMENT (...))::text
      
      END LOOP;
      RETURN QUERY select '</foo>
      
    END LOOP;
  END LOOP;
  
  
  
 but if I wrap this in a function, it seems that I won't get a result before the whole document is prepared.
 
 Is there any way to stream the result as it get produced ?
 or does anybody knows of a good tutotial for a task like this ?
 
 
 thanks and best regards,
 
 Marc Mamin


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux