Skip site navigation (1) Skip section navigation (2)

locks and triggers. give me an advice please

From: sad <sad(at)bankir(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: locks and triggers. give me an advice please
Date: 2004-07-20 05:36:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Good day.

often, I am turning triggers off and on to perform a mass operation on a 
table, and i am interested how should i care of another user operations.

the scene is:
table t1 with user defined triggers
and many tables reference t1, (so FK triggers defined on t1) 

the operation i want to perform on t1 makes a great load to a server
and have no use in triggers at all.
the best way to perform this operation is to delete all records, modify, and 
insert them back without changing any adjuscent table. 
(this way takes a few seconds.)
so i turn off triggers on t1 completely (updating pg_class.reltriggers)
and turn on triggers on t1.

it works fine.

the question is:

what should i do to prevent other users of data modification on the t1 and the 
adjuscent tables while triggers is off ?


...what about TEXT to REGCLASS casting ?

In response to


pgsql-sql by date

Next:From: Luis SousaDate: 2004-07-20 08:17:15
Subject: Re: Problem in age on a dates interval
Previous:From: Rosser SchwarzDate: 2004-07-19 22:29:32
Subject: Re: Group by failing on Null values

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group