pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roger Ging <roger@musicreports.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Broken pg_class table
Date: Sun, 16 Jul 2006 08:28:35 -0700
Message-ID: <44BA5B23.2070204@musicreports.com> (raw)
In-Reply-To: <27390.1153026781@sss.pgh.pa.us>
References: <44B7FCA1.40006@musicreports.com>
	<27390.1153026781@sss.pgh.pa.us>

<!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.1153026781@sss.pgh.pa.us" type="cite">
  <pre wrap="">Roger Ging <a class="moz-txt-link-rfc2396E" href="mailto:roger@musicreports.com">&lt;roger@musicreports.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>



view thread (5+ messages)  latest in thread

Message-ID: <44BA5B23.2070204@musicreports.com>
Permalink:  ../44BA5B23.2070204@musicreports.com/
Also on:    postgresql.org/message-id/44BA5B23.2070204@musicreports.com

 · 

reply

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: roger@musicreports.com, tgl@sss.pgh.pa.us
  Subject: Re: Broken pg_class table
  In-Reply-To: <44BA5B23.2070204@musicreports.com>
  References: <44B7FCA1.40006@musicreports.com> <27390.1153026781@sss.pgh.pa.us> <44BA5B23.2070204@musicreports.com>

* 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