Skip to content

Commit b833206

Browse files
authored
Create postgresql-commands.md
1 parent 79e0f5c commit b833206

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

postgresql-commands.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
**Connect database container**
2+
```
3+
docker exec -it postgres psql -U postgres
4+
[sakhtar@linux docker-compose-postgres]$ docker exec -it postgres psql -U postgres
5+
psql (12.4)
6+
Type "help" for help.
7+
8+
postgres=#
9+
```
10+
11+
**List Database**
12+
```
13+
postgres=# \l
14+
List of databases
15+
Name | Owner | Encoding | Collate | Ctype | Access privileges
16+
-----------+----------+----------+------------+------------+-----------------------
17+
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
18+
shamim | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
19+
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
20+
| | | | | postgres=CTc/postgres
21+
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
22+
| | | | | postgres=CTc/postgres
23+
(4 rows)
24+
25+
postgres=#
26+
27+
```

0 commit comments

Comments
 (0)