Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1xtf-0001eI-3J for pgsql-general@arkaria.postgresql.org; Sun, 25 Aug 2019 19:09:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1xtd-0004ry-Iv for pgsql-general@arkaria.postgresql.org; Sun, 25 Aug 2019 19:09:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1xtd-0004qe-7n for pgsql-general@lists.postgresql.org; Sun, 25 Aug 2019 19:09:49 +0000 Received: from smtp104.iad3a.emailsrvr.com ([173.203.187.104]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1xtZ-0004FG-AL for pgsql-general@lists.postgresql.org; Sun, 25 Aug 2019 19:09:48 +0000 X-Auth-ID: david.wall@myeastside.com Received: by smtp38.relay.iad3a.emailsrvr.com (Authenticated sender: david.wall-AT-myeastside.com) with ESMTPSA id 967883C07 for ; Sun, 25 Aug 2019 15:09:42 -0400 (EDT) X-Sender-Id: david.wall@myeastside.com Received: from [10.138.21.190] (50-46-115-165.evrt.wa.frontiernet.net [50.46.115.165]) (using TLSv1.2 with cipher AES128-SHA) by 0.0.0.0:465 (trex/5.7.12); Sun, 25 Aug 2019 15:09:42 -0400 To: pgsql-general@lists.postgresql.org From: David Wall Subject: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred? Message-ID: <3e16442c-a60a-679a-e72e-6d895552b6f8@computer.org> Date: Sun, 25 Aug 2019 12:09:41 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Using the latest PostgreSQL, does it matter if my code does a ROLLBACK or a COMMIT on an non-modifying SELECT statement?  My impression is they'd be the same as nothing is changed and therefore there's nothing to commit or rollback, but wondered if there was any difference in how they are processed by Postgres? Thanks, David