Skip to content

Database

Erik Chen edited this page Sep 6, 2023 · 4 revisions

Planscape Database

Overview

We use PostGIS, which roughly means Postgres + PostGIS extensions for map-related operations. The DB is used for storing user account information, user data (plans, scenarios), as well as layer data used for computation (e.g. per-stand averages of RRK metrics).

Configuration

Planscape expects a DB user named "planscape", and a database also named "planscape". For convenience, the planscape DB user may have superuser privileges.

We use Django to manage the DB schema, including userauth-related tables.

Command Line Tool (psql)

You can use psql in order to inspect the database

pqsl -U user -d database -h host e.g., if you are connecting to your own instance on your box: psql -U planscape -d planscape -h localhost

If you set up a password for the planscape user, you'll be prompted for the password here.

Useful commands

Command Description Example
describe a table's schema \d table_name \d auth_user
list all tables \dt \dt

There are various psql cheat sheets like this.