-
Notifications
You must be signed in to change notification settings - Fork 111
/
postgres_dirs_pre11.9.sql
48 lines (42 loc) · 1.48 KB
/
postgres_dirs_pre11.9.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--
-- Author: Hari Sekhon
-- Date: 2020-08-06 10:34:23 +0100 (Thu, 06 Aug 2020)
--
-- vim:ts=4:sts=4:sw=4:et:filetype=sql
--
-- https://github.com/HariSekhon/SQL-scripts
--
-- License: see accompanying Hari Sekhon LICENSE file
--
-- If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
--
-- https://www.linkedin.com/in/HariSekhon
--
-- Useful PostgreSQL dir info
--
-- Requires PostgreSQL >= 10
--
-- Tested on PostgreSQL 10.x, 11.x, 12.x, 13.0
SELECT
current_setting('config_file') AS "config_file",
current_setting('hba_file') AS "hba_file",
current_setting('ident_file') AS "ident_file";
SELECT
current_setting('data_directory') AS "data_directory",
current_setting('external_pid_file') AS "external_pid_file";
SELECT
current_setting('unix_socket_directories') AS "unix_socket_directories",
current_setting('unix_socket_permissions') AS "unix_socket_permissions",
current_setting('unix_socket_group') AS "unix_socket_group";
SELECT
-- not available on PostgreSQL < 10
pg_current_logfile(),
current_setting('log_directory') AS "log_directory", -- log
current_setting('log_filename') AS "log_filename"; -- postgresql-%Y-%m-%d_%H%M%S.log
SELECT
-- CASE WHEN pg_current_logfile() IS NOT NULL THEN pg_ls_logdir() END AS pg_ls_logdir,
pg_ls_waldir()
-- not available on PostgreSQL <= 11.8
--pg_ls_archive_statusdir(),
--pg_ls_tmpdir();
;