Re: How to isolate the result of SELECT's?

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Andre Lopes <lopes80andre(at)gmail(dot)com>
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to isolate the result of SELECT's?
Date: 2012-03-19 00:00:05
Message-ID: CAOzAquJV0pjEtd_MQBG4oZ0eSkAJJ8vmjnVQe_Eu21EFNCVrBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Mar 18, 2012 at 6:33 PM, Andre Lopes <lopes80andre(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2012-03-19 00:21:26 Re: How to isolate the result of SELECT's?
Previous Message Andre Lopes 2012-03-18 23:33:27 How to isolate the result of SELECT's?