niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » PostgreSQL
Statement cancel or transaction cancel?
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Qingqing Zhou
*nix forums Guru Wannabe


Joined: 11 Mar 2005
Posts: 101

PostPosted: Fri Mar 11, 2005 8:07 am    Post subject: Statement cancel or transaction cancel? Reply with quote

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




---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Back to top
Sean Davis
*nix forums Guru Wannabe


Joined: 01 Mar 2005
Posts: 172

PostPosted: Fri Mar 11, 2005 10:50 am    Post subject: Re: Statement cancel or transaction cancel? Reply with quote

On Mar 11, 2005, at 4:07 AM, Qingqing Zhou wrote:

Quote:
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


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 6:50 am | All times are GMT
navigation Forum index » Databases » PostgreSQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Select statement Shamna Sybase 0 Mon Sep 17, 2007 6:03 am
No new posts ECPG (usage of simple select statement) Jasbinder Bali PostgreSQL 0 Fri Jul 21, 2006 3:28 am
No new posts tremendous upturn on pink sheets, overwhelmingly importan... Larry Hurd devel 0 Mon Jul 17, 2006 4:50 pm
No new posts Help for a SQL Query statement: group by roberto IBM DB2 3 Mon Jul 17, 2006 12:43 pm
No new posts what's wrong with my code? about the #if statement. Python.LeoJay@gmail.com C 7 Mon Jul 17, 2006 8:14 am

Anime | Credit Counseling | Credit Cards | Bankruptcy | Libros de historia
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1318s ][ Queries: 16 (0.0491s) ][ GZIP on - Debug on ]