Search⌘ K

Emergency Pub

Explore how to leverage PostgreSQL and its extensions to perform geolocation lookups based on IP addresses. Understand how to efficiently find nearby locations such as pubs with just a single SQL query and apply this technique in real-world applications.

What if you want to make an application to help people find the nearest pub from where they are currently? Now that you know their location from the IP address they’re using in their browser, it should be easy enough, right?

We have downloaded a list of pubs from the UK; we’re going to use an IP address that should be in the UK too. Let’s assume www.ox.ac.uk has the address 129.67.242.154.

Geolocation of an IP address

Knowing that ...