[postgis-users] create xml file from sql table

Mike Toews mwtoews at gmail.com
Tue Oct 19 07:51:09 PDT 2010


>From a user's standpoint, PostgreSQL (and PostGIS) does not write files. In
order to read/write files, you need tools (psql, pgAdminIII, pgsql2shp,
etc.). You need to write a custom tool for your situation in PHP.

Ignoring details, you will need a database connection from PHP to
PostgreSQL, run your query, and put the text result into PHP. Once PHP has
this data, you can open a file in write mode and write the lines to the
file.

-Mike

On 19 October 2010 04:37, zhang zhe <luckyclare at hotmail.com> wrote:

>  Hello,
>
> Does anyone knows how to generate xml file from postgres table.
>
> select table_to_xml(‘building3’,true,true,’’);
>
> will print xml file in data output . How can I generate a file, and save it
> to directory automatically. I want to write this function in php code.
>
>
>
> Thank you very much.
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101019/47ac7e86/attachment.html>


More information about the postgis-users mailing list