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