title: generate json with PostgreSQL
body: <p>I have postgreSQL 8.4+PostGIS 1.5.</p>
  
  <p>I want to generate GeoJson. I do:</p>
  
  <pre><code>SELECT row_to_json(fc)
   FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
   FROM (SELECT 'Feature' As type
  , ST_AsGeoJSON(lg.the_geom)::json As geometry
  , row_to_json(lp) As properties
     FROM parcels_temp As lg 
       INNER JOIN (SELECT num, cadastr FROM parcels_temp) As lp 
     ON lg.num = lp.num  ) As f )  As fc;
  </code></pre>
  
  <p>But get an error: </p>
  
  <pre><code> ERROR:  type "json" does not exist
   LINE 4:     , ST_AsGeoJSON(lg.the_geom)::json As geometry
  </code></pre>
  
  <p>What am I doing wrong?</p>