-
Notifications
You must be signed in to change notification settings - Fork 4
Tools
- Database
- Application
- Processing
- Testing
Option 1: Postgres.app
- Install Postgres.app
- Configure your path
- Verify that your path is correct:
which psql # should be /Applications/Postgres.app/Contents/Versions/9.4/bin/psql
Option 2: homebrew
- Update homebrew references -
brew update
- Kill existing postgres process:
ps aux | grep postgres
sudo kill -term <# of process 'server log'>
- Upgrade Postgres - `brew upgrade postgres``
- Install Postgis -
brew install postgis
Upgrading Postgres after installing Postgis will break Postgres' links to Postgis.
Install Postico
psql
create database seattle;
\connect seattle
create extension postgis; # enable postgis
\quit
Afterwards, import your data with shp2pgsql
. One-line it with:
shp2pgsql -s 4326 -d -g the_geom shapefilename.shp shapefilename |psql -U username --password -p 5432 -h reallylonghostnametoamazonaws.com dbname
Start Postico, hit connect
, and check that the data you intended import was imported.
Manipulate a postgres database and it's records.
Login to the RDS instance with:
psql --host seattle-emergency.cwydhyrq6asz.us-west-2.rds.amazonaws.com --port 5432 --username codefellows --password --dbname seattle
Import a sql query:
psql -h hostname -d databasename -U username -f file.sql
Convert shapefiles into sql queries that can be loaded into postgres with psql.
shp2pgsql -s 4326 -d -g the_geom input.shp > output.sql
Visualize and manipulate geospatial datasets. Install with homebrew.
Normally all tests will use an in-memory SQLite database. You can run your tests with a different backend by using the --sql-url= commandline option. For example to run all tests against a local PostgreSQL server using the pytest database:
$ bin/py.test --sql-url=postgresql:///pytest