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

From: David Wall <d(dot)wall(at)computer(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?
Date: 2019-08-25 19:09:41
Message-ID: 3e16442c-a60a-679a-e72e-6d895552b6f8@computer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2019-08-25 19:20:11 Re: Postgres SQLSTATE[08006] [7] timeout expired
Previous Message Adrian Klaver 2019-08-25 18:56:04 Re: Postgres SQLSTATE[08006] [7] timeout expired