From 5a7e9f2c2c46a4bdc13348cc1f2321a5c2df6043 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Sun, 7 Oct 2018 14:35:40 -0400 Subject: [PATCH] Updated settings and commandline articles --- commandline/README.md | 5 +++++ configuration/README.md | 14 ++++++++++++++ configuration/conf.sql | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 commandline/README.md create mode 100644 configuration/README.md create mode 100644 configuration/conf.sql diff --git a/commandline/README.md b/commandline/README.md new file mode 100644 index 0000000..ab8ee21 --- /dev/null +++ b/commandline/README.md @@ -0,0 +1,5 @@ +# Postgres commandline tools + +## pg_ctl + +## diff --git a/configuration/README.md b/configuration/README.md new file mode 100644 index 0000000..a88c790 --- /dev/null +++ b/configuration/README.md @@ -0,0 +1,14 @@ +# FILES + +## Logs + +Log files can be found in two places. The most recent log file will be located in the postgres data directory. Other log files will be located via a config setting typically set to directory under the data directory. This can be found using the `SHOW log_directory` sql commnad. + +## Config files + +The configuration files are located directly under the + +- postgresql.conf - +- postgres.auto.conf - +- pg_hba.conf - +- diff --git a/configuration/conf.sql b/configuration/conf.sql new file mode 100644 index 0000000..87f7077 --- /dev/null +++ b/configuration/conf.sql @@ -0,0 +1,32 @@ + +-- REOAD and RESTART +-- +-- As a superuser you can trigger a configuration reload with +-- SELECT pg_reload_conf(); +-- Some config(fundamental) changes require a restart. Use the cmd commands: +-- `service postgresql- restart` +-- `pg_ctl restart -D ` + +-- LOCATION OF CONFIG FILES +-- +SELECT name, setting +FROM pg_settings +WHERE category = 'File Locations'; + +-- CHECK postgresql.conf SETTINGS +-- +SELECT name, context, unit, setting, boot_val, reset_val +FROM pg_settings +WHERE name IN ('listen_addresses', 'deadlock_timeout', 'shared_buffers', + 'effective_cache_size', 'work_mem', 'maintenance_work_mem') +ORDER BY context, name; + + +-- SHOW keyword +-- We can use the SHOW sql command to display settings with a labeled results in a labeled +SHOW ALL; +-- Individual settings can also be shown +SHOW work_mem; + +--ALTER postgresql.conf SETTINGS +-- ALTER SYSTEM SET work_mem = '500MB';