Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFBmB-0006AX-2Z for pgsql-general@arkaria.postgresql.org; Wed, 24 Oct 2018 05:32:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gFBm8-0004j9-Ok for pgsql-general@arkaria.postgresql.org; Wed, 24 Oct 2018 05:32:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFBm7-0004Wx-BW for pgsql-general@lists.postgresql.org; Wed, 24 Oct 2018 05:32:11 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gFBm0-0004Ci-Dh for pgsql-general@lists.postgresql.org; Wed, 24 Oct 2018 05:32:09 +0000 Received: from smtp2.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 9408BA1335; Wed, 24 Oct 2018 07:32:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id ZdX0BbK-kh7h; Wed, 24 Oct 2018 07:31:59 +0200 (CEST) Message-ID: Subject: Re: Oracle vs PG From: Laurenz Albe To: Ravi Krishna , adrian.klaver@aklaver.com Cc: pgsql-general@lists.postgresql.org Date: Wed, 24 Oct 2018 07:31:57 +0200 In-Reply-To: <1519969091.2232047.1540337737856@mail.yahoo.com> References: <52fdf2eb-1fdc-5233-aa5f-75b33a88e8c1@aklaver.com> <6DD461F9-7FF5-4A54-AB04-9507648D76CE@aol.com> <60e0bcc4-342c-ce57-c319-125eda75b13b@aklaver.com> <1519969091.2232047.1540337737856@mail.yahoo.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ravi Krishna wrote: > I have hardly used savepoints in any application, but if I understand it correctly, isn't it something which is typically used > in a persistent connection. I wonder how it is applicable in a web based stateless application like Amazon.com, unless > even web based application have database level state. I have seen people use savepoints in PostgreSQL to emulate Oracle's "statement rollback" behavior: If a statement fails, only the statement is undone, but the transaction continues. If you insert a savepoint before *every* statement in a transaction, you can get a similar behavior in PostgreSQL, but the performance will suck. Perhaps that is what happened in this case. Of course the correct solution is to redesign and use savepoints only where you *expect* an error, or at least batch a number of statements with each savepoint. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com