pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: locks and triggers. give me an advice please
Date: Tue, 20 Jul 2004 09:36:44 +0400
Message-ID: <200407200936.44292.sad@bankir.ru> (raw)
In-Reply-To: <37d451f70407191529610a8eba@mail.gmail.com>
References: <000001c46ddd$491501d0$c201a8c0@borderveygqj37>
	<37d451f70407191529610a8eba@mail.gmail.com>

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)
operate
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 ?

thnx.


P.S.
...what about TEXT to REGCLASS casting ?





view thread (3+ messages)  latest in thread

Message-ID: <200407200936.44292.sad@bankir.ru>
Permalink:  ../200407200936.44292.sad@bankir.ru/
Also on:    postgresql.org/message-id/200407200936.44292.sad@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: locks and triggers. give me an advice please
  In-Reply-To: <200407200936.44292.sad@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox