https://github.com/purcell/with-temp-postgres
Temporarily run postgres against a pre-existing data directory while you run a command
https://github.com/purcell/with-temp-postgres
Last synced: about 1 month ago
JSON representation
Temporarily run postgres against a pre-existing data directory while you run a command
- Host: GitHub
- URL: https://github.com/purcell/with-temp-postgres
- Owner: purcell
- Created: 2020-05-11T03:39:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T21:30:59.000Z (almost 5 years ago)
- Last Synced: 2025-01-30T04:23:35.598Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 1000 Bytes
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# with-temp-postgres
This is a handy script for temporarily running postgresql while you
execute a command: the DB is started against the specified data
directory (which must already exist), then the command is run, and
finally the DB is stopped again.The DB listens only on a domain socket, and appropriate values of the
standard `PG*` environment variables are set while running the
specified command such that it will use that connection.In conjunction with Nix, for example, this can be used to access data
from old DB installations, e.g.```
nix-shell -p postgresql_9_6 --run "./with-temp-postgres /usr/local/var/postgres-9.6 psql -l"
```