Re: Difference between terminate/cancel?

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: François Beausoleil <francois(at)teksol(dot)info>, Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Difference between terminate/cancel?
Date: 2013-08-13 17:25:24
Message-ID: 1376414724.40105.YahooMailNeo@web162901.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

François Beausoleil <francois(at)teksol(dot)info> wrote:

> What is the difference between both?

> I had some processes stuck in IDLE in transaction after a machine
> died (through pgbouncer), and cancel did not close the
> connections, while terminate did kill the transactions.

> The docs at
> http://www.postgresql.org/docs/9.1/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE
> [...]

According to the docs you cite:

pg_cancel_backend(): Cancel a backend's current query
pg_terminate_backend(): 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.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thodi Viola 2013-08-13 17:29:17 Re: Please help
Previous Message François Beausoleil 2013-08-13 17:05:52 Difference between terminate/cancel?