Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 775569FA48F for ; Wed, 27 Dec 2006 16:09:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 73834-03 for ; Wed, 27 Dec 2006 16:09:34 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by postgresql.org (Postfix) with ESMTP id 663219F93A2 for ; Wed, 27 Dec 2006 16:09:36 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id i11so1863328nzh for ; Wed, 27 Dec 2006 12:09:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=jWZptP2FuOKW+pyymNm15SkT2kaXnV2mJPRX6GKv/gXliazWo+QmWAg8AoYTHmhg0kX/F4nU4avkdTtjQjnMDCAGUaAPKwVWup+OXBYgER6eQEUExSP4L+J/+gLBT0xfqvExmgxaZzBpzi6IRzr7uwLPX/F3Y+t/0b+siQKWRik= Received: by 10.65.153.10 with SMTP id f10mr4222708qbo.1167250175516; Wed, 27 Dec 2006 12:09:35 -0800 (PST) Received: by 10.65.206.17 with HTTP; Wed, 27 Dec 2006 12:09:35 -0800 (PST) Message-ID: Date: Thu, 28 Dec 2006 01:09:35 +0500 From: "Shoaib Mir" To: "Kashmira Patel (kupatel)" Subject: Re: Unable to drop table, error mentions "reltriggers" Cc: pgsql-sql@postgresql.org In-Reply-To: <18AE59788A3FC640A367E5652E664D800361DCF7@xmb-sjc-237.amer.cisco.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_68099_24657419.1167250175469" References: <18AE59788A3FC640A367E5652E664D800361DCF7@xmb-sjc-237.amer.cisco.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/176 X-Sequence-Number: 27132 ------=_Part_68099_24657419.1167250175469 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Run the following: update pg_class set reltriggers = count(*) from pg_trigger where pg_class.oid=tgrelid and relname='vm_message'; It should solve the problem.... ------------------ Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 12/28/06, Kashmira Patel (kupatel) wrote: > > Hello, > I have two tables as follows: > > create table vm_message > ( > MessageId varchar(128) not null, > MessageType integer not null default 1, > UseCount integer not null default 1, > Sender varchar(256) not null, > Urgent boolean not null default false, > Private boolean not null default false, > MessageLength integer , > MessageSize integer , > MessageTime bigint , > AttachedMsgId varchar(128) , > MessageOid OID , > UTCTime varchar(32) , > EndTime bigint not null default > 9223372036854775807, > ReceiveTime bigint not null default 0, > NdrReason integer , > StartTime bigint default 0, > MWIOn boolean not null default false, > TotalMessageLength integer not null default 0, > uid serial not null UNIQUE, > CallerPhoneNumber varchar(15) not null default '', > foreign key (AttachedMsgId) references vm_message on delete cascade on > update cascade, > primary key (MessageId) > ); > create table vm_future_msg_job > ( > MessageId varchar(128) not null, > Recipients varchar(1024) not null, > StartTime bigint not null, > JobType int default 0, > foreign key (MessageId) references vm_message on delete cascade on > update cascade, > primary key (MessageId,Recipients) > ); > > When I try to drop either one of these tables, I get the following error: > ERROR: relation "vm_message" has reltriggers = 0 > and the table does not get dropped. > > What does this error mean??? > > > ------=_Part_68099_24657419.1167250175469 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Run the following:

update pg_class set reltriggers = count(*) from pg_trigger where pg_class.oid=tgrelid and relname='vm_message';

It should solve the problem....

------------------
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 12/28/06, Kashmira Patel (kupatel) < kupatel@cisco.com> wrote:
Hello,
   I have two tables as follows:
 
create table vm_message
(
    MessageId                varchar(128)          not null,
    MessageType              integer               not null default 1,
    UseCount                 integer               not null default 1,
    Sender                   varchar(256)          not null,
    Urgent                   boolean               not null default false,
    Private                  boolean               not null default false,
    MessageLength            integer                       ,
    MessageSize              integer                       ,
    MessageTime              bigint                        ,
    AttachedMsgId            varchar(128)                  ,
    MessageOid               OID                           ,
    UTCTime                  varchar(32)                   ,
    EndTime                  bigint                not null default 9223372036854775807,
    ReceiveTime              bigint                not null default 0,
    NdrReason                integer                       ,
    StartTime                bigint                default 0,
    MWIOn                    boolean               not null default false,
    TotalMessageLength       integer               not null default 0,
    uid                      serial             not null UNIQUE,
    CallerPhoneNumber        varchar(15)           not null default '',
    foreign key (AttachedMsgId) references vm_message on delete cascade on update cascade,
    primary key (MessageId)
);
create table vm_future_msg_job
(
    MessageId                varchar(128)          not null,
    Recipients               varchar(1024)         not null,
    StartTime                bigint                not null,
    JobType                  int                   default 0,
    foreign key (MessageId) references vm_message on delete cascade on update cascade,
    primary key (MessageId,Recipients)
);
 
When I try to drop either one of these tables, I get the following error:
ERROR: relation "vm_message" has reltriggers = 0
and the table does not get dropped.
 
What does this error mean???
 
 

------=_Part_68099_24657419.1167250175469--