The postgis function ST_GeomFromGeoJSON sometimes cause database crash.
http://dba.stackexchange.com/questions/83264/st-geomfromgeojson-causes-postgres-to-crash
http://trac.osgeo.org/postgis/ticket/3002
And I cannot find any solution for it.
Therefore, I do it workaround.
I convert the geojson to kml and then use ST_GeomFromKML.
https://github.com/mapbox/tokml
var kml = tokml(geojson.geometry);
//left only the geometry part
kml = kml.replace(‘<?xml version=”1.0” encoding=”UTF-8”?><kml xmlns=”http://www.opengis.net/kml/2.2"><Document><Placemark><ExtendedData></ExtendedData>’, “”).replace(“</Placemark></Document></kml>”, “”);