From: Robert Treat <xzilla@users.sourceforge.net>
To: Kuhn, Dylan K " "(4520500D) <Dylan.Kuhn@navy.mil>
Cc: marie.tuite@edisonaffiliates.com
Cc: pgsql-admin@postgresql.org
Subject: Re: bulk DELETE speed
Date: 19 May 2003 15:45:38 -0400
Message-ID: <1053373538.23813.46.camel@camel> (raw)
In-Reply-To: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576D5@NAWECHLKEX01VA.nadsuswe.nads.navy.mi l>
References: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576D5@NAWECHLKEX01VA.nadsuswe.nads.navy.mi l>
On Fri, 2003-05-16 at 15:07, Kuhn, Dylan K (4520500D) wrote:
> I'm not deleting all the records, but I could maybe copy the ones I want
> to keep into a temporary table. It looks like I have to somehow disable
> the foreign key constraints that reference the table before truncating
> it. Is this possible?
>
Syntax for 7.2.x is:
UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" = 'mytable';
UPDATE pg_class SET reltriggers = (SELECT count(*) FROM pg_trigger where pg_class.oid = tgrelid) WHERE relname = 'mytable';
I think it's the same in 7.3.x, but double check before using it.
Robert Treat
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: xzilla@users.sourceforge.net, Dylan.Kuhn@navy.mil, marie.tuite@edisonaffiliates.com
Subject: Re: bulk DELETE speed
In-Reply-To: <1053373538.23813.46.camel@camel>
References: <1053373538.23813.46.camel@camel>
* 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