I am not sure how to make postgres query where (col1, col2) in 2dslice
I have tried the following:
CREATE TABLE table2 (
id CHAR(27) NOT NULL,
lat FLOAT8 NOT NULL,
lon FLOAT8 NOT NULL,
PRIMARY KEY (id)
);
latlongdata := [][]float64{}
latlongdata = append(latlongdata, []float64{1.2, 2.3},)
latlongdata = append(latlongdata, []float64{1.3, 2.4},)
......................................
latlongdata = append(latlongdata, []float64{1.4, 2.5},)
fmt.Println(latlongdata)// prints [[1.2 2.3] [1.3 2.4] ....... [1.4 2.5]] (very long array)
Query: r.db.QueryContext(ctx,("SELECT id, lat, lon FROM table2 WHERE (lat, lon) IN $1", latlongdata,)
Can you please suggest how to do it?