Now per folder configs are loaded after PG_CONFIG
Call stopdb when deactivating env
This commit is contained in:
parent
14e4b865ca
commit
202b89c381
2 changed files with 5 additions and 5 deletions
|
@ -24,7 +24,7 @@ pg${PGV}.conf
|
||||||
pg${PGV}-<Cluster #>.conf
|
pg${PGV}-<Cluster #>.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
PostgreSQL local configs per are named similarly but starts with (.) dot and stored in worktree folder. These will superseed `${GIT_DIR}/pgconfigs/`:
|
PostgreSQL local configs per folder are named similarly but starts with (.) dot and stored in worktree folder. These will overlay on top of `${GIT_DIR}/pgconfigs/` settings.
|
||||||
|
|
||||||
```
|
```
|
||||||
.pg${PGV}.conf
|
.pg${PGV}.conf
|
||||||
|
|
8
pg-env
8
pg-env
|
@ -314,19 +314,17 @@ pexec(){
|
||||||
setupdb(){
|
setupdb(){
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
initdb --data-checksums --username=${USER}
|
initdb --data-checksums --username=${USER}
|
||||||
|
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
||||||
if [ -f "$(pwd)/.pg${PGV}.conf" ]; then
|
if [ -f "$(pwd)/.pg${PGV}.conf" ]; then
|
||||||
echo "include = '$(pwd)/.pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
echo "include = '$(pwd)/.pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
||||||
else
|
|
||||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}.conf'" >> ${PGDATA}/postgresql.conf
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
for NodeN in $@
|
for NodeN in $@
|
||||||
do
|
do
|
||||||
initdb --data-checksums --username=${USER} -D ${PGDATA}-${NodeN}
|
initdb --data-checksums --username=${USER} -D ${PGDATA}-${NodeN}
|
||||||
|
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
||||||
if [ -f "$(pwd)/.pg${PGV}-${NodeN}.conf" ]; then
|
if [ -f "$(pwd)/.pg${PGV}-${NodeN}.conf" ]; then
|
||||||
echo "include = '$(pwd)/.pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
echo "include = '$(pwd)/.pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
||||||
else
|
|
||||||
echo "include = '${GIT_DIR}/pgconfigs/pg${PGV}-${NodeN}.conf'" >> ${PGDATA}-${NodeN}/postgresql.conf
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -353,6 +351,8 @@ resetall() {
|
||||||
}
|
}
|
||||||
|
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
stopdb
|
||||||
|
stopdb 1 2 3
|
||||||
export PATH=${SAVED_PATH}
|
export PATH=${SAVED_PATH}
|
||||||
export PS1=${SAVED_PS1}
|
export PS1=${SAVED_PS1}
|
||||||
if [ ! -z "$VIRTUAL_ENV" ]; then
|
if [ ! -z "$VIRTUAL_ENV" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue