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 1i1ysD-0002P8-G1 for pgsql-general@arkaria.postgresql.org; Sun, 25 Aug 2019 20:12:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1yrD-0002Ja-Rn for pgsql-general@arkaria.postgresql.org; Sun, 25 Aug 2019 20:11:23 +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 1i1yrD-0002JH-Cf for pgsql-general@lists.postgresql.org; Sun, 25 Aug 2019 20:11:23 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1yr9-0002QR-T5 for pgsql-general@lists.postgresql.org; Sun, 25 Aug 2019 20:11:23 +0000 Received: by mail-io1-xd2e.google.com with SMTP id p12so32380632iog.5 for ; Sun, 25 Aug 2019 13:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=bnW0gN1cmAX/qjctbmXmMtyC1IqD93ZKHHc1NRDqlYU=; b=o6NnN3vkxuuaXWfB2kEVswQgbmOtR+rqr/oRbhxcSYdeKPaVejX1piO/x298QQUfO/ jFCdmAeIkOGfqWTP1cC7JOFDcenr3Zlx/Y9vEg1XBY7LrDq5RwpWmV5+NdyfefxwjiB7 6j4qPWord8YcP7O2/+VBwhttDoJt4aqGRw2LXtSebQQ9mMUzs2UxtuGdqSwgEKxCNaX6 S70DLs+IgphbqgM4cS/9WuddJNQSDYaY3TWa0JVuoE3AFPEWBhFYRYt1WMx2H6xRDQb5 IyszFDEPHr1c74w5M3Z4Yb6+jLEtVtGUk64YtKnGplNIzRon/pUsUswF2r0znfu7X5Ky NxvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=bnW0gN1cmAX/qjctbmXmMtyC1IqD93ZKHHc1NRDqlYU=; b=sTR9siQn67vIK8gWk51QuXOlawUsgZ9jYoBkpxb2v2nJp9mk2n+HKYtEr0G29Yd15p qS+oMnHzeS5QpafdJf9towaGzyRdf+PrCUXe5Iy/pvyGov5v2vwWR0dC72PKGd6LaKvT pO4wKl6rpTQCrUNtRlJAKOMCneAWMXEtRMpTQ+zwOOYTZW7cwtlWPSuAHV84RqlBY/7I OH/+IwB7nrfOXX30UYr5f9t2M9BifhQUhe1HGyxskOucROBkQU2hbuoxVBrJE+6CJaOq HREfl/1pqF5HU0lkOpzcyKzoi2X3By04V9CPfH0us/vbik/vNSUNZ3NOXlFuPdo1eH9X 5QVw== X-Gm-Message-State: APjAAAU6SlfEBsLswWBwIgrZBgbmcz54p0jJuOQO5sNWrgLOOTLHugp2 HXE2GYdx5ShsrbbeqawQ8A7YZO31 X-Google-Smtp-Source: APXvYqzi/AAu/KjFl5DPb5qJ9OtGLaN5xFw+CyeSs5NcJkgXD7zqzTxFa2foItFrEEq9mpGP6aX30Q== X-Received: by 2002:a5d:8484:: with SMTP id t4mr19243208iom.5.1566762052022; Sun, 25 Aug 2019 12:40:52 -0700 (PDT) Received: from [192.168.1.108] (c-73-63-59-118.hsd1.ut.comcast.net. [73.63.59.118]) by smtp.gmail.com with ESMTPSA id w5sm11888467iom.33.2019.08.25.12.40.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Aug 2019 12:40:51 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred? From: Rob Sargent In-Reply-To: <3e16442c-a60a-679a-e72e-6d895552b6f8@computer.org> Date: Sun, 25 Aug 2019 13:40:50 -0600 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <3C2ED636-A81D-4BC4-92A1-38634F5DD5D2@gmail.com> References: <3e16442c-a60a-679a-e72e-6d895552b6f8@computer.org> To: David Wall X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Aug 25, 2019, at 1:09 PM, David Wall wrote: >=20 > 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? >=20 > Thanks, > David >=20 >=20 >=20 In interactive psql, both issue a warning that there is no current = transaction. What is your auto-commit setting and how is your code sent = to the server?=