What's the difference between functions: pg_cancel_backend(pid int) and pg_terminate_backend(pid int)? For me they work pretty the same.
"Cancellation" occurs when either party puts an end to the contract for breach by the other and its effect is the same as that of "termination" except that the cancelling party also retains any remedy for breach of the whole contract or any unperformed balance.
The other basic difference between invalidation and cancellation lies in their ground. The ground for invalidation is defect in its formation while the ground for cancellation is non-performance.
Contract rescission is the legal term used when a contract is terminated or cancelled. It may also be called “overturning” or “cancellation” of a contract. Contract rescission ends the contract. Often, this also cancels any of the legal responsibilities that were in the contract.
pg_cancel_backend() cancels the running query while pg_terminate_backend() terminates the entire process and thus the database connection.
When a program creates a database connection and sends queries, you can cancel one query without destroying the connection and stopping the other queries. If you destroy the entire connection, everything will be stopped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With