From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>, Ericson Smith <eric(at)did-it(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Triggers and COPY |
Date: | 2003-09-25 15:30:34 |
Message-ID: | 200309251630.34672.dev@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thursday 25 September 2003 16:06, Shridhar Daithankar wrote:
> Ericson Smith wrote:
> > Hi,
> >
> > Is there any way to prevent a trigger from firing during a COPY
> > operation?
> >
> > We have a case where we dump the records from a table, truncate it, and
> > copy the records back in. However, there is a trigger on that table,
> > which will insert a record in a logging table. Is there a way to prevent
> > this trigger from firing during the COPY FROM process?
>
> Can you drop the trigger during copy? I don't know following will exactly
> work but something like..
>
> begin
> drop trigger
> copy
> recreate trigger
> commit;
>
> could do trick for you..
You might be able to do this with pg_restore too. That's got the ability to
disable triggers.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2003-09-25 15:40:04 | Re: German translation of PostgreSQL documentation |
Previous Message | Tim McAuley | 2003-09-25 15:12:50 | Re: sequence's plpgsql |