PostgreSQL on OpenWrt
PostgreSQL on OpenWrt is mostly like PostgreSQL on many Linux servers.
Move the database from volatile storage to persistent storage
The default location for the PostgreSQL database on OpenWrt is /var/postgresql/data which is on a RAM disk (tmpfs) and goes away on every reboot. We want to change that.
- Prepare your persistent storage and set it to automatically mount on every boot (fstab). For this guide we assume you mount the storage on
/srv. service postgresql stop- Edit
/etc/config/postgresqlso that `PGDATA` points to/srv/postgresql/data mv /var/postgresql /srv/service postgresql start- Verify postgresql is running (E.g. via
ps w/pgrep) andlogread