Add new page for PostgreSQL
This commit is contained in:
parent
55272ba94d
commit
b63aacb5d7
|
@ -9,5 +9,6 @@
|
|||
- [Raspberry Pi Commands](./pi.md)
|
||||
- [macOS Commands](./macos.md)
|
||||
- [T-SQL](./tsql.md)
|
||||
- [PostgreSQL](./postgresql.md)
|
||||
- [Angular](./angular.md)
|
||||
- [Windows Terminal](./windows-terminal.md)
|
||||
|
|
|
@ -16,7 +16,7 @@ whoami
|
|||
|
||||
## System management
|
||||
```bash
|
||||
# Reboot
|
||||
# Reboot/restart.
|
||||
sudo reboot
|
||||
sudo shutdown -r now
|
||||
# Reboot in 5 minutes.
|
||||
|
|
|
@ -3,6 +3,7 @@ The following is a list of globals I tend to install with Node. Items are listed
|
|||
|
||||
```
|
||||
npm install ___ -g
|
||||
npm install -g ___
|
||||
```
|
||||
|
||||
Again, you can run `npm ls -g --depth 0` to view any packages that have been installed globally.
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# PostgreSQL
|
||||
Unless otherwise noted, non-SQL commands are running under Ubuntu.
|
||||
|
||||
```bash
|
||||
# List all databases.
|
||||
sudo -u postgres psql -l
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
```bash
|
||||
# Show the full path to the PostgreSQL configuration file.
|
||||
sudo -u postgres psql -c 'SHOW config_file'
|
||||
# Example: /etc/postgresql/12/main/postgresql.conf
|
||||
|
||||
# Show the full path to the HBA configuration file.
|
||||
sudo -u postgres psql -c 'SHOW hba_file'
|
||||
# Example: /etc/postgresql/12/main/pg_hba.conf
|
||||
```
|
||||
|
||||
```sql
|
||||
-- Locate the HBA configuration file.
|
||||
SHOW hba_file;
|
||||
-- Example: /etc/postgresql/12/main/pg_hba.conf
|
||||
|
||||
-- Or just query the file for rules.
|
||||
select * from pg_hba_file_rules();
|
||||
```
|
Loading…
Reference in New Issue