Encountered the same issue and went with this even...
# off-topic
v
Encountered the same issue and went with this eventually: >
Copy code
> CREATE OR REPLACE FUNCTION geography_to_geojson(geography) RETURNS json AS $$
>   SELECT extensions.ST_AsGeoJSON($1)::json;
> $$ LANGUAGE SQL;
> 
> CREATE CAST (geography AS json) WITH FUNCTION geography_to_geojson(geography);
>
geography fields as GeoJSON
l
thanks @User ! it worked perfectly