-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpostgresql
More file actions
20 lines (17 loc) · 838 Bytes
/
postgresql
File metadata and controls
20 lines (17 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
1. initdb
sudo -upostgres initdb -E UTF8 -k --locale=en_US.UTF-8 -D /var/lib/postgresql
-L : used for init template, the default template init script is /usr/share/postgresql/postgres.bki
2. start service
systemctl restart postgresql
3. createdb
createdb -U postgres fsdb "main database for fusion splicer configuration"
#note: if you can't start postgresql service in some cases, e.g. installing
you can use following command to run postgresql under single user mode:
su -l postgres -c "cat /mnt/data/initdb.sql | postgres --single -D /mnt/data
/database -j"
4. rebuild template1
$ psql -U postgres postgres
update pg_database set datistemplate = false where datname='template1';
drop database template1;
create database template1 template=template0;
update pg_database set datistemplate = true where datname='template1';