PostgreSQL
Service overview
| Software owner | PostgreSQL Global Development Group |
|---|---|
| Management | wfmanager (start | stop | restart | status) postgresql |
| Log files | Access logs: |
| Startup scripts | <INSTALL_DIR>/supervisord/apps/postgresql.ini/postgres/bin/postgres |
| Configuration files | PostreSQL main config file: <INSTALL_DIR>/postgres/data/postgresql.confPostreSQL access configuration file: <INSTALL_DIR>/postgres/data/pg_hba.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 the PostgreSQL DB |
secrets.yml | postgresql_admin_user | postgres | Admin username for the PostgreSQL DB on the DB server |
secrets.yml | postgresql_admin_pass | CAD7K\*KT9u | Admin password for the PostgreSQL DB on the 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/postgresss 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- Access logs:
Use the wfmanager util to check the postgresql out (access) log:
wfmanager tail postgresql
Enabling debug information.
Add the appropriate options to <INSTALL_DIR>/postgres/data.postgres.conf and restart the 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
# %% = '%'
# e.g. '<%u%%%d> '
For example:
log_line_prefix = '[%p] [%c] [%m] [%x]: '
log_statement = 'all'
wfmanager restart postgresql