Lists: | Postg토토 꽁 머니SQL |
---|
From: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Statement cancel or transaction cancel? |
Date: | 2005-03-11 09:07:13 |
Message-ID: | d0rnchd0rnch$1kf4$1@news.hub.orgkf4d0rnch$1kf4$1@news.hub.org@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Pg8.0.1
backend> begin;
backend> create table a (i int);
backend> insert into a values(1);
1: i (typeid = 23, len = 4, typmod = -1, byval = t)
----
backend> select * from pg_class;
1: relname (typeid = 19, len = 64, typmod = -1, byval = f)
2: relnamespace (typeid = 26, len = 4, typmod = -1, byval =
t)
3: reltype (typeid = 26, len = 4, typmod = -1, byval = t)
4: relowner (typeid = 23, len = 4, typmod = -1, byval = t)
... before the query is finished, press a ctrl_c here ...
ERROR: canceling query due to user request
backend> select * from a;
ERROR: current transaction is aborted, commands ignored until end of
transaction block
backend> commit;
backend> select * from a;
ERROR: relation "a" does not exist
So ctrl_c in a backend actually means cancel the whole transaction (instead
of statement)?
Thanks,
Qingqing
From: | Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> |
---|---|
To: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Statement cancel or transaction cancel? |
Date: | 2005-03-11 11:50:00 |
Message-ID: | 6bdbd5328d8fb5ae8867aa0a3bf2cce9@mail.nih.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 꽁 머니SQL |
On Mar 11, 2005, at 4:07 AM, Qingqing Zhou wrote:
> Pg8.0.1
>
> backend> begin;
> backend> create table a (i int);
> backend> insert into a values(1);
> 1: i (typeid = 23, len = 4, typmod = -1, byval = t)
> ----
> backend> select * from pg_class;
> 1: relname (typeid = 19, len = 64, typmod = -1, byval = f)
> 2: relnamespace (typeid = 26, len = 4, typmod = -1,
> byval =
> t)
> 3: reltype (typeid = 26, len = 4, typmod = -1, byval = t)
> 4: relowner (typeid = 23, len = 4, typmod = -1, byval = t)
>
> ... before the query is finished, press a ctrl_c here ...
>
> ERROR: canceling query due to user request
> backend> select * from a;
> ERROR: current transaction is aborted, commands ignored until end of
> transaction block
> backend> commit;
> backend> select * from a;
> ERROR: relation "a" does not exist
>
> So ctrl_c in a backend actually means cancel the whole transaction
> (instead
> of statement)?
CTRL-C yields an error, which I think will cause the transaction to
fail, yes.
Sean