[PyGreSQL] returning XML data

Jerome Alet alet at unice.fr
Tue Apr 18 15:57:11 EDT 2000


Hi,

I'm wondering if it would be useful to add a method to PygreSQL to return
query results as XML data.

e.g. for a table like that:

CREATE TABLE mytable(id INT4, firstname TEXT);

and a query like that:

SELECT * FROM mytable;

then return something like:

<XMLRESULT>
  <LENGTH>
    2
  <LENGTH>
  <ROW number="1">
    <COLUMN name="id">
      3
    </COLUMN>
    <COLUMN name="firstname">
      Jerome
    </COLUMN>
  </ROW>
  <ROW number="2">
    <COLUMN name="id">
      25
    </COLUMN>
    <COLUMN name="firstname">
      Alfred
    <COLUMN>
  </ROW>
</XMLRESULT>

I personnally don't need it for now, but maybe this would be interesting
for someone ?

Or do you think it would be better to let PostgreSQL itself handle that ?

any ideas ?

Jerome ALET - alet at unice.fr - http://cortex.unice.fr/~jerome
Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 
28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE





More information about the PyGreSQL mailing list