difference between pg_cancel_backend() and pg_terminate_backend() in postgreSql

pg_cancel_backend():- 
                             Cancels the running query ,Cancel a backend’s current query

pg_terminate_backend():-
                             Terminates the entire process and thus the database connection,terminate a backend A connection which is idle or idle in transaction does not have a current query to cancel, but it has a backend process which can be terminated.

Leave a comment