Which (table) lock mode to use

From: Ben <newreaders(at)gmail(dot)com>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Which (table) lock mode to use
Date: 2004-12-15 00:55:34
Message-ID: 5f4a64610412141655640e56a6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I have this scenario and would like to use lock table for this but I
don't know which mode I should use.

When I delete/update/insert a record from/to a table, I need to update
some fields of all the records in this table. During this process I
don't want anyone to insert, update or delete the data but allow them
to select the data at the original state.

I am currently using:

LOCK TABLE tbl_name IN SHARE ROW EXCLUSIVE MODE

Is this the correct mode to use?

Thanks,
Ben

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Vadnais 2004-12-15 01:15:08 VACUUM FULL [ANALYZE] problem
Previous Message Dann Corbit 2004-12-15 00:43:20 Re: Corrupt RTREE index