Re: Rollback of Query Cancellation

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: Abdul Rahman <abr_ora(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rollback of Query Cancellation
Date: 2009-01-28 05:56:38
Message-ID: 3073cc9b0901272156x60d7deds47d685993823adec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 28, 2009 at 12:19 AM, Abdul Rahman <abr_ora(at)yahoo(dot)com> wrote:
> Dear All,
>
> PostgreSQL does not perform rollback action. Is it true?
>

no. postgresql executes all statements that are outside an explicit
transaction in its own implicit one [1] executing commit at the end,
if you cancelled the query the commit never executed and the records
were never deleted...

even more to the point, postgres never delete tuples on delete just
mark them as invalid since transaction number X. at commit time the
transaction is marked as correctly finished and all changes are WAL
logged then suddenly changes take effect... rollback never mark the
transaction as finished and doesn't save WAL records (that meaning
that changes never spread to the datafiles)

actually ROLLBACK is very cheap just don't save changes, COMMIT makes
all the work...

now, your post make me think that you think the ROLLBACK never
executed based on... reponse time? very unscientific (there are plenty
other reasons for that to happen)

[1] http://www.postgresql.org/docs/8.3/static/tutorial-transactions.html

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2009-01-28 06:22:44 Re: Rollback of Query Cancellation
Previous Message Abdul Rahman 2009-01-28 05:56:04 Re: Rollback of Query Cancellation