How to properly config track_functions

All we need is an easy explanation of the problem, so here it is.

localhost:5432 [email protected]=# set track_functions to 'all';
SET
localhost:5432 [email protected]=# SELECT pg_reload_conf();
+----------------+
| pg_reload_conf |
+----------------+
| t              |
+----------------+
(1 row)

localhost:5432 [email protected]=# \c -
psql (15beta1 (Ubuntu 15~~devel~20220516.2230-1~803.git05a5a17.pgdg20.04+1), server 14.3 (Ubuntu 14.3-1.pgdg20.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
You are now connected to database "test" as user "admin".
localhost:5432 [email protected]=# show track_functions ;
+-----------------+
| track_functions |
+-----------------+
| none            |
+-----------------+
(1 row)

After I reconnect, the track_function return to none. How to config set it to all all the time?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

set only changes the value for the current session. It is lost when you disconnect. If you want to persist the change across sessions (and Postgres restarts) you need to use ALTER SYSTEM:

alter system set track_functions to 'all';
SELECT pg_reload_conf();

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply