blob: 379b2457887ba6e9d7dc1ddd764568d363f507df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
ppq - Portable PostgreSQL
=========================
This allows running PostgreSQL locally without having to set up a
system-wide service. It is portable in the sense that you can move the
directory around, and you can run multiple instances side-by-side.
It serves as a good basis to use as a development environment, for
projects that require a Postgres server.
How to use
----------
The best way to run this project is with Nix and direnv. You don't
need NixOS.
Simply cd into the directory, and direnv should take care of the rest.
Then you can run a Postgres server with `./ppq start`.
All Postgres client programs (like `psql`, `pg_restore` etc) are
available and environment variables like `PGUSER` and `PGHOST` are set
up to ensure it will talk to the local Postgres server automatically.
Customizing the project
-----------------------
The `.envrc` file loads a `.envrc.local` if it exists. Here, you can
override any environment variables you want. The following environment
variables can be overridden:
PPQ_POSTGRES_VERSION - the major Postgres version to use
PPQ_POSTGRES_DIR - The *absolute path* to the directory that holds that data dir
PPQ_POSTGRES_DATA_DIR - The *absolute path* to the PostgreSQL data directory
Note that you can use direnv's expand_path function to make a relative
path absolute.
The `ppq.sh` script will also execute `${PPQ_POSTGRES_DIR}/prepare.sql`
when preparing the database via initdb.
If you want to add `postgresql.conf` settings, you can create a file
called `${PPQ_POSTGRES_DIR}/postgresql_overrides.conf` and it will be
loaded by `postgresql.conf`.
|