-
Notifications
You must be signed in to change notification settings - Fork 6
/
pgstart.sh
executable file
·33 lines (28 loc) · 1.09 KB
/
pgstart.sh
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
# .bash_aliases in $HOME directory ; ls -a =list all files ,included . hidden
#!/bin/sh
#export PATH=/usr/lib/postgresql/9.6/bin:$PATH
#export PGDATA=$HOME/data
export PATH=/usr/lib/postgresql/10/bin:$PATH
export PGDATA=$HOME/data10
#/usr/lib/postgresql/9.6/bin/pg_ctl start -D $HOME/data
pg_ctl start
exit 0
# creating cluster directory right after sudo apt-get install postgresql
# pg_ctl -D /home/globik/data10 initdb
# pg_ctl status [check if server running
# psql -l [list all databases
# psql postgres [connect to databes 'postgres'
# select*from users; [dummy command
# \q [quit
# pg_ctl stop
# .bash_aliases
#alias dab="ls"
#alias pgstart="sudo chmod a+w /var/run/postgresql && /usr/lib/postgresql/9.6/bin/pg_ctl start -D $HOME/data"
#alias pgstop="/usr/lib/postgresql/9.6/bin/pg_ctl stop -D $HOME/data"
# export / import database
# pg_dump -U globik postgres > kore.pgsql (export to file) current db must running
# psql -U globik alikon < dbexport.sql = import db export file
#psql postgres = connect to the db by name postgres
#createdb alikon = create new db
#dropdb postgres
#createdb postgres