Discussion:
Error when dropping table
(too old to reply)
Chris White (cjwhite)
2004-06-23 19:29:23 UTC
Permalink
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

and the table is not dropped. What does this message mean and how can I
drop the table?
Tom Lane
2004-06-23 20:32:28 UTC
Permalink
Post by Chris White (cjwhite)
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. Could we see
the exact error display with "\set VERBOSITY verbose"?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
Tom Lane
2004-06-23 20:38:17 UTC
Permalink
Post by Tom Lane
Post by Chris White (cjwhite)
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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Chris White (cjwhite)
2004-06-23 21:01:01 UTC
Permalink
Thanks

-----Original Message-----
From: Tom Lane [mailto:***@sss.pgh.pa.us]
Sent: Wednesday, June 23, 2004 1:38 PM
To: ***@cisco.com
Cc: pgsql-***@postgresql.org
Subject: Re: [ADMIN] Error when dropping table
Post by Tom Lane
Post by Chris White (cjwhite)
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


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Chris White (cjwhite)
2004-06-23 21:00:43 UTC
Permalink
ERROR: XX000: relation "vm_message" has rel_triggers = 0
LOCATION: RemoveTriggerById, commands/trigger.c:581


-----Original Message-----
From: pgsql-admin-***@postgresql.org
[mailto:pgsql-admin-***@postgresql.org] On Behalf Of Tom Lane
Sent: Wednesday, June 23, 2004 1:32 PM
To: ***@cisco.com
Cc: pgsql-***@postgresql.org
Subject: Re: [ADMIN] Error when dropping table
Post by Chris White (cjwhite)
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. Could we see
the exact error display with "\set VERBOSITY verbose"?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Loading...