Kmlpostgis
From DreamsteepWiki
ST_AsKML([version], geometry, [precision])
Return the geometry as a KML element. Second argument may be used to reduce the maximum number of significant digits used in output (defaults to 15). Version defaults to 2
Requires PostGIS be compiled with Proj support. Use PostGIS_Full_Version() to confirm you have proj support compiled in.

