(Postgrex.Error) ERROR (internal_error): Operation on mixed SRID geometries

I’m having trouble getting PostGIS query to work with the Geo Package. I get the error with the following code:

    geom = %Geo.Point{coordinates: {49.2771732, -123.1222821}, srid: 4236}
    query = from p in Foodhunt.Photo,
      join: l in assoc(p, :location),
      order_by: st_distance(l.geom, ^geom),
      preload: [:location]

My guess was that it’s because some Photos don’t have a location so I tried adding where: st_srid(l.geom) == 4236 but then I don’t get anything from the query. Any thoughts?

Hm… The following doesn’t give me anything as well.

query = from l in Foodhunt.Location,
  where: st_srid(l.geom) == 4236

Here’s how I’m storing the geometry:

field :geom, Geo.Geometry 

and here’s an example data entry:

geom: %Geo.Point{coordinates: {151.2008966, -33.8919025}, srid: 4326}

After trying the query directly in postgres and with the help slack channel, we found that it was my stupid mistake. I put 4326 instead of 4236…