Importing to PostgreSQL
With pgAdmin
Download the
us-cities.zipfile using the unique download link we emailed to you after purchase. This link looks like:https://www.uscitieslist.org/download/xxxx-xxxx/Once the download has finished double-click the
us-cities.zipfile and extract theus-cities/sql/us-cities.sqlscript to your computer. Make a note of the location you extract theus-cities.sqlfile to — you'll need it in step 5.Open pgAdmin.
Select
Tools > Query Toollfrom the navigation bar.From the Query Tool select
File > Openfrom the navigation and open theus-cities.sqlfile that you extracted in step 2.Select
Query > Executefrom the navigation to run the script. This will create a new table calledus_citiesand insert the data. This typically takes a few seconds to complete.
With the terminal (Mac & Linux)
Press
CTRL+ALT+Tto open a new terminal window.Download the
us-cities.zipfile using the unique download link we emailed to you after purchase. You can do this with thewgetcommand:$ wget -O us-cities.zip https://www.uscitieslist.org/download/xxxx-xxxx/Once the download has finished decompress the
us-cities.zipfile. You can do this with theunzipcommand:$ unzip us-cities.zipUse the
psqlcommand with the-fflag to create the table and import the data from the script. For example to import the data into theexample_dbdatabase you should use the command below.$ psql -d example_db -f us-cities/sql/us-cities.sql