Re: How to isolate the result of SELECT's? - Mailing list pgsql-general

From Michael Nolan
Subject Re: How to isolate the result of SELECT's?
Date
Msg-id CAOzAquJV0pjEtd_MQBG4oZ0eSkAJJ8vmjnVQe_Eu21EFNCVrBA@mail.gmail.com
Whole thread Raw
In response to How to isolate the result of SELECT's?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general


On Sun, Mar 18, 2012 at 6:33 PM, Andre Lopes <lopes80andre@gmail.com> wrote:
Hi,

I need to do an operation that I will use some SELECT's and get the
results, but I want to have sure that those tables have not been
changed with INSERT's or UPDATES during the operation.

Example:

BEGIN OPERATION
Select field from table1;
...
Select other_field from table2;
...
END OPERATION

How can I lock these tables to assure that the tables are not getting
INSERTS's or UPDATE's during the operation?

Best Regards,\


Isn't that what 'begin transaction' and 'commit' are for?
 --
Mike Nolan

pgsql-general by date:

Previous
From: Andre Lopes
Date:
Subject: How to isolate the result of SELECT's?
Next
From: Adrian Klaver
Date:
Subject: Re: How to isolate the result of SELECT's?