Add linux notes
This commit is contained in:
17
linux/postgres_commands.txt
Executable file
17
linux/postgres_commands.txt
Executable file
@@ -0,0 +1,17 @@
|
||||
Start:
|
||||
su postgres
|
||||
psql
|
||||
|
||||
Show databases:
|
||||
\l
|
||||
|
||||
Switch to database:
|
||||
\c [name]
|
||||
|
||||
Show tables
|
||||
\dt
|
||||
|
||||
Create new database and user:
|
||||
create database mydb;
|
||||
create user myuser with encrypted password 'mypass';
|
||||
grant all privileges on database mydb to myuser;
|
||||
Reference in New Issue
Block a user