PostgreSQL
Service overview
| Software owner | The PostgreSQL Global Development Group |
|---|---|
| Management | wfmanager (start | stop | restart | status) postgresql |
| Log files | Access logs: <INSTALL_DIR>/supervisord/log/postgresql.out.log |
| Startup scripts | <INSTALL_DIR>/supervisord/apps/postgresql.ini /postgres/bin/postgres |
| Configuration files | postgresql main config file: <INSTALL_DIR>/postgres/data/postgresql.conf |
| Default Ports | tcp 5432 |
Default parameters
| Configuration file | Name | Default Value | Description |
|---|---|---|---|
| config.yml | install_dir | /opt/workfusion | Directory to put user files, logs and configs |
| config.yml | postgresql_port | 5432 | Default service port for PostgreSQL DB |
| secrets.yml | postgresql_admin_user | postgres | Admin username for PostgreSQL DB on DB server |
| secrets.yml | postgresql_admin_pass | CAD7K*KT9u | Admin password for PostgreSQL DB on DB server |
Troubleshooting
Check if TCP port 5432 is available (port may be custom).
netstat command output
$ netstat -lntp | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 17628/postgres
tcp6 0 0 :::5432 :::* LISTEN 17628/postgres
ss command output
$ ss -ltn | grep 5432
LISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
lsof command output
$ lsof -P -n -i :5432 | grep LISTEN
postgres 17628 wfuser 3u IPv4 175661 0t0 TCP *:5432 (LISTEN)
postgres 17628 wfuser 4u IPv6 175662 0t0 TCP *:5432 (LISTEN)
Check the default main log files:
- Access logs: <INSTALL_DIR>/supervisord/log/postgresql.out.log
- Error logs: <INSTALL_DIR>/supervisord/log/postgresql.err.log
$ tail -f <INSTALL_DIR>/supervisord/log/postgresql.err.log <INSTALL_DIR>/supervisord/log/postgresql.out.log
Wfmanager util can be used to check postgresql out (access) log:
wfmanager tail postgresql
Enabling debug information.
Add the appropriate options to <INSTALL_DIR>/postgres/data.postgres.conf and restart postgresql service. Find below the description of available options.
${install_dir}/postgres/data.postgres.conf
#log_line_prefix = '' ## special values:
## %a = application name
## %u = user name
## %d = database name
## %r = remote host and port
## %h = remote host
## %p = process ID
## %t = timestamp without milliseconds
## %m = timestamp with milliseconds
## %i = command tag
## %e = SQL state
## %c = session ID
## %l = session line number
## %s = session start timestamp
## %v = virtual transaction ID
## %x = transaction ID (0 if none)
## %q = stop here in non-session
## processes
## %% = '%'
##, for example, '<%u%%%d> '
For example:
log_line_prefix = '[%p] [%c] [%m] [%x]: '
log_statement = 'all'
wfmanager restart postgresql