You can use ST_ClosestPoint()
to find the closest one to each point. If you use that in combination with make line you should be able to achieve what you need. Here is a link to the documentation for ST_ClosestPoint().
Dylan Hamilton
- 294
- 1
- 10