Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?
Date: 2019-08-25 19:40:50
Message-ID: 3C2ED636-A81D-4BC4-92A1-38634F5DD5D2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Aug 25, 2019, at 1:09 PM, David Wall <d(dot)wall(at)computer(dot)org> wrote:
>
> 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
>
>
>
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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Howard Wells 2019-08-25 19:48:06 Re: Postgres SQLSTATE[08006] [7] timeout expired
Previous Message Johann 'Myrkraverk' Oskarsson 2019-08-25 19:37:50 Re: pgcharts on Ubuntu 18.04 ?