Re: bulk DELETE speed - Mailing list pgsql-admin

From Robert Treat
Subject Re: bulk DELETE speed
Date
Msg-id 1053373538.23813.46.camel@camel
Whole thread Raw
In response to bulk DELETE speed  ("Kuhn, Dylan K (4520500D)" <Dylan.Kuhn@navy.mil>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Együd Csaba
Date:
Subject: Cygwin - Postgres won't start
Next
From: "Stefan Sturm"
Date:
Subject: Howto Setup a good PostgreSQL Server