X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3A3929FB1BC for ; Sun, 16 Jul 2006 12:29:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 63555-05 for ; Sun, 16 Jul 2006 15:29:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.musicreports.com (unknown [207.47.100.34]) by postgresql.org (Postfix) with ESMTP id 18C759FA0B9 for ; Sun, 16 Jul 2006 12:29:13 -0300 (ADT) Received: from [192.168.3.105] (FERRARI [192.168.3.105]) by exchange.musicreports.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id MB1PXQRP; Sun, 16 Jul 2006 08:29:09 -0700 Message-ID: <44BA5B23.2070204@musicreports.com> Date: Sun, 16 Jul 2006 08:28:35 -0700 From: Roger Ging User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Tom Lane CC: pgsql-admin@postgresql.org Subject: Re: Broken pg_class table References: <44B7FCA1.40006@musicreports.com> <27390.1153026781@sss.pgh.pa.us> In-Reply-To: <27390.1153026781@sss.pgh.pa.us> Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/134 X-Sequence-Number: 22380 Sorry, should have been more specific.
Version 8.1.0

update statement called from a bash script where $tbl is table name and $sch is schema name

update pg_class set reltriggers =
(select count(*) from pg_trigger where tgrelid =
(select oid from pg_class where relname = '$tbl' and relnamespace =
(select oid from pg_namespace where nspname = '$sch')))--should have been a limiting where clause here


Thanks,

Roger

Tom Lane wrote:
Roger Ging <roger@musicreports.com> writes:
  
I accidentally wrecked the pg_class table in a database by leaving off 
the where clause of an update statement when setting the reltriggers 
back to the count from pg_trigger after a bulk data load.
    

What was the *exact* update statement, and which PG version is this?

			regards, tom lane