Add new page for PostgreSQL

This commit is contained in:
James Skemp 2022-06-17 23:03:56 -05:00
parent 55272ba94d
commit b63aacb5d7
4 changed files with 31 additions and 1 deletions

View File

@ -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)

View File

@ -16,7 +16,7 @@ whoami
## System management
```bash
# Reboot
# Reboot/restart.
sudo reboot
sudo shutdown -r now
# Reboot in 5 minutes.

View File

@ -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.

28
src/postgresql.md Normal file
View File

@ -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();
```