Skip to content

Commit 6359c71

Browse files
authored
Create create-postgresql-db.txt
1 parent 9fee6c6 commit 6359c71

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

create-postgresql-db.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
postgresql server yaratish va sozlash
2+
3+
4+
db o'rniga o'zizi database nomini qo'yasiz.
5+
user o'rniga kerakli username.
6+
passwordni ham o'zizga moslab olasiz!
7+
8+
9+
sudo apt update
10+
sudo apt list --upgradable
11+
sudo apt upgrade -y
12+
sudo apt install libpq-dev postgresql postgresql-contrib -y
13+
sudo -i -u postgres psql
14+
15+
CREATE DATABASE db;
16+
CREATE USER user WITH PASSWORD 'pass';
17+
ALTER ROLE user SET client_encoding TO 'utf8';
18+
ALTER ROLE user SET default_transaction_isolation TO 'read committed';
19+
ALTER ROLE user SET timezone TO 'UTC';
20+
GRANT ALL PRIVILEGES ON DATABASE db TO user;
21+
22+
\l
23+
24+
GRANT ALL PRIVILEGES ON SCHEMA public TO user;
25+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO user;
26+
\q

0 commit comments

Comments
 (0)