X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 871D05292A for ; Mon, 6 Jun 2005 10:26:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72266-08 for ; Mon, 6 Jun 2005 13:26:30 +0000 (GMT) Received: from asmodeus.mcnaught.org (sp-260-1.net4.netcentrix.net [4.21.254.118]) by svr1.postgresql.org (Postfix) with ESMTP id D88C25292D for ; Mon, 6 Jun 2005 10:26:29 -0300 (ADT) Received: from [66.156.61.59] (helo=Douglas-McNaughts-Powerbook.local) by asmodeus.mcnaught.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1DfHcW-0002VS-L6; Mon, 06 Jun 2005 09:26:24 -0400 To: "Surabhi Ahuja " Cc: Subject: Re: transactions References: From: Douglas McNaught Date: Mon, 06 Jun 2005 09:21:15 -0400 In-Reply-To: (Surabhi Ahuja's message of "Mon, 6 Jun 2005 18:27:03 +0530") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/240 X-Sequence-Number: 78948 "Surabhi Ahuja " writes: > Hello everyone. > I have the following question: > > say i have two transactions going on simultaneoulsy. > in one transaction i do an insertion > and the other transaction i do a delete. > what will happen if in both the transactions, the insert(in one) and > delete(in the other) are issued at exactly the same time? will bothe get > blocked and enter into a deadlock, if yes then do both the transactions > get aborted after some time of waiting. The transactions will be executed completely independently, unless you do explicit locking (via SELECT FOR UPDATE or LOCK TABLE). -Doug