Updated on 2023-10-23 GMT+08:00

PQbackendPID

Supplementary Explanation

After GaussDB is multi-thread refactored based on PostgreSQL, the semantic of PQbackendPID is different from that in the native PostgreSQL libpq. In GaussDB, the return value of the PQbackendPID function indicates the slot ID of the background thread, not the backend PID of the background thread. Due to the preceding difference, you are not advised to execute this function by following the PostgreSQL semantics. To obtain the backend PID of the connection, you can use the pg_backend_pid system function. In addition, other driver APIs which depend on libpq and have the same names as PostgreSQL's APIs (such as the get_backend_pid function of the Python connection driver psycopg2) also comply with the preceding rule.