Re: Broken pg_class table

From: Roger Ging <roger(at)musicreports(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Broken pg_class table
Date: 2006-07-16 15:28:35
Message-ID: 44BA5B23.2070204@musicreports.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sorry, should have been more specific.<br>
Version 8.1.0<br>
<br>
update statement called from a bash script where $tbl is table name and
$sch is schema name<br>
<br>
update pg_class set reltriggers = <br>
(select count(*) from pg_trigger where tgrelid = <br>
(select oid from pg_class where relname = '$tbl' and relnamespace = <br>
(select oid from pg_namespace where nspname = '$sch')))--should have
been a limiting where clause here<br>
<br>
<br>
Thanks,<br>
<br>
Roger<br>
<br>
Tom Lane wrote:
<blockquote cite="mid27390(dot)1153026781(at)sss(dot)pgh(dot)pa(dot)us" type="cite">
<pre wrap="">Roger Ging <a class="moz-txt-link-rfc2396E" href="mailto:roger(at)musicreports(dot)com">&lt;roger(at)musicreports(dot)com&gt;</a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
What was the *exact* update statement, and which PG version is this?

regards, tom lane
</pre>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-07-16 19:00:10 Re: Broken pg_class table
Previous Message Tom Lane 2006-07-16 05:13:01 Re: Broken pg_class table