Added forgejo db info, added commands to cheatsheet
This commit is contained in:
parent
b5433f9d69
commit
a598aede1b
1 changed files with 8 additions and 2 deletions
|
|
@ -8,7 +8,8 @@ icon: simple/postgresql
|
||||||
|
|
||||||
| Database | Address | Port | User |
|
| Database | Address | Port | User |
|
||||||
| ----------- | ----------- | ---- | -------- |
|
| ----------- | ----------- | ---- | -------- |
|
||||||
| postgres | 10.10.10.20 | 5432 | postgres |
|
| postgres | 10.10.10.50 | 5432 | postgres |
|
||||||
|
| forgejo | 10.10.10.50 | 5432 | forgejo |
|
||||||
***All passwords stored in KeePassXC database.***
|
***All passwords stored in KeePassXC database.***
|
||||||
|
|
||||||
## Cheatsheet
|
## Cheatsheet
|
||||||
|
|
@ -22,7 +23,12 @@ icon: simple/postgresql
|
||||||
| Create a database | `CREATE DATABASE _mydb_;`
|
| Create a database | `CREATE DATABASE _mydb_;`
|
||||||
| Create a user with a password | `CREATE USER _myuser_ WITH PASSWORD 'mypassword';`
|
| Create a user with a password | `CREATE USER _myuser_ WITH PASSWORD 'mypassword';`
|
||||||
| Grant all permission of a database to Postgres user | `GRANT ALL PRIVILEGES ON DATABASE _mydb_ TO _myuser_;`
|
| Grant all permission of a database to Postgres user | `GRANT ALL PRIVILEGES ON DATABASE _mydb_ TO _myuser_;`
|
||||||
|
| Set database owner | `ALTER DATABASE _mydb_ OWNER TO _myuser_;`
|
||||||
| Connect to a database | `\c _db_name_`
|
| Connect to a database | `\c _db_name_`
|
||||||
| Connect to a database as specific user | `\c _db_name_ _pg_user_`
|
| Connect to a database as specific user | `\c _db_name_ _pg_user_`
|
||||||
| Switch back to default database | `\c postgres postgres`
|
| Switch back to default database | `\c postgres postgres`
|
||||||
| Create a table | `CREATE TABLE _table_name_;`
|
| Create a table | `CREATE TABLE _table_name_;`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Last Updated: August 2, 2025*
|
||||||
Loading…
Add table
Add a link
Reference in a new issue