I have this query that is trying to update my geom column that's built off of lat and lng coordinates
UPDATE main_table SET geom = ST_SetSRID(ST_MakePoint(lng, lat) ,4326);
However it returns that function st_makepoint(text, text) does not exist
and gives me a hint to add explicit type casts, so I updated my query to
UPDATE main_table SET geom = ST_SetSRID(
ST_MakePoint(lng:: double precision, lat:: double precision) ,4326);
And now it's throwing an error invalid input syntax for type double precision:
.
Just a note, right now my lats and longs are stored as text because I had to use a pg restore
to load the table, so I'm sure that's where the problem is but don't know how to address it.
invalid input syntax for type double precision: ""
? If so, you need to filter these out withWHERE lng <> '' AND lat <> ''
.