pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: cjwhite@cisco.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Error when dropping table
Date: Wed, 23 Jun 2004 16:38:17 -0400
Message-ID: <5398.1088023097@sss.pgh.pa.us> (raw)
In-Reply-To: <5344.1088022748@sss.pgh.pa.us>
References: <028f01c45958$63e76640$0200a8c0@amer.cisco.com>
	<5344.1088022748@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:
> "Chris White (cjwhite)" <cjwhite@cisco.com> writes:
>> On 7.4.2, I am trying to drop a table using the command
>> drop table vm_message cascade;
>> and I get the error message 
>> relation "vm_message" has rel_triggers = 0

> I can't find any such error message in the 7.4 sources.

Oh, here it is --- should have checked the spelling of the pg_class
field:
		elog(ERROR, "relation \"%s\" has reltriggers = 0",
			 RelationGetRelationName(rel));

The most likely bet is that a failed pg_restore left the relation's
triggers disabled.  You can fix this by doing what the restore should
have done:

UPDATE pg_catalog.pg_class SET reltriggers = 
(SELECT count(*) FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) 
FROM pg_catalog.pg_namespace 
WHERE relnamespace = pg_namespace.oid AND nspname !~ '^pg_';

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <5398.1088023097@sss.pgh.pa.us>
Permalink:  ../5398.1088023097@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5398.1088023097@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, cjwhite@cisco.com
  Subject: Re: Error when dropping table
  In-Reply-To: <5398.1088023097@sss.pgh.pa.us>
  References: <028f01c45958$63e76640$0200a8c0@amer.cisco.com> <5344.1088022748@sss.pgh.pa.us> <5398.1088023097@sss.pgh.pa.us>

* 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