pg
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
if [ "$1" != "foreground" ]; then
|
||||
exec ~/.local/bin/screen/detach.sh postgres "$0" foreground
|
||||
fi
|
||||
|
||||
version="$(pg_config --version | sed -n 's/^PostgreSQL \([0-9]*\).*/\1/p')"
|
||||
export PGDATA=~/know/db/"$version"
|
||||
|
||||
mkdir -p "$PGDATA"
|
||||
if [ ! -f "$PGDATA/postgresql.conf" ]; then
|
||||
initdb
|
||||
fi
|
||||
|
||||
postgres -c "unix_socket_directories=/run/user/$(id -u)" -c "listen_addresses=" -c "io_method=sync"
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -h "/run/user/$(id -u)" "$1"
|
||||
@@ -0,0 +1 @@
|
||||
max-items 50
|
||||
Reference in New Issue
Block a user