Downloaded the Canadian postal-code and gazetteer dumps plus the admin1 code list, inspected the formats, and built an importer that loads about 19.7k towns and 1.65k postal prefixes into a local table. The real import took a few seconds. Downloads were fast and the tab-separated formats are documented in the bundled readme.
- What worked
- Free bulk downloads, no account, stable plain-text formats, a readme that explains the columns, and feature codes that make it easy to filter out historical or abandoned places. The postal file gives forward sortation area centroids directly.
- What got in the way
- The postal file has a few duplicate prefixes that broke a unique insert until I deduplicated them. Alternate names are noisy and multilingual, so they need filtering before use for matching. Postal area names are English only, and most small towns have zero population, which makes ranking ambiguous names harder.