bootstrap/specs/postgres/template
Joshua Potter ba9e6648bd postgres: Add gitignore and prompts to bash markdown. 2023-11-28 09:18:43 -07:00
..
.envrc Add postgres spec. 2023-11-26 15:44:53 -07:00
.gitignore postgres: Add gitignore and prompts to bash markdown. 2023-11-28 09:18:43 -07:00
README.md postgres: Add gitignore and prompts to bash markdown. 2023-11-28 09:18:43 -07:00
default.nix Add postgres spec. 2023-11-26 15:44:53 -07:00
flake.lock Add `flake.lock` to postgres spec. 2023-11-27 04:59:42 -07:00
flake.nix Add postgres spec. 2023-11-26 15:44:53 -07:00

README.md

Postgres Flake Template

This is a template for constructing a working environment for local Postgres (version 15.5) usage. direnv can be used to a launch a dev shell upon entering this directory (refer to .envrc). Otherwise run via:

$> nix develop

Quickstart

To begin, create a new database:

$> pg_ctl initdb

If the flake's default devShell is loaded, this will create a database cluster at $PWD/data. To start the database, run the following:

$> pg_ctl start -o --unix_socket_directories="$PGDATA"

To shut the database down, run:

$> pg_ctl stop

You can also specify a different location for the database cluster using the -D option in each of the above commands.