How to properly config track_functions



  • localhost:5432 admin@test=# set track_functions to 'all';
    SET
    localhost:5432 admin@test=# SELECT pg_reload_conf();
    +----------------+
    | pg_reload_conf |
    +----------------+
    | t              |
    +----------------+
    (1 row)
    
    localhost:5432 admin@test=# \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 admin@test=# 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?



  • 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();
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2