pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Unable to drop table, error mentions "reltriggers"
2+ messages / 2 participants
[nested] [flat]

* Unable to drop table, error mentions "reltriggers"
@ 2006-12-27 19:52  Kashmira Patel (kupatel) <kupatel@cisco.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Kashmira Patel \(kupatel\) @ 2006-12-27 19:52 UTC (permalink / raw)
  To: pgsql-sql

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???
 
 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Unable to drop table, error mentions "reltriggers"
@ 2006-12-27 20:09  Shoaib Mir <shoaibmir@gmail.com>
  parent: Kashmira Patel (kupatel) <kupatel@cisco.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Shoaib Mir @ 2006-12-27 20:09 UTC (permalink / raw)
  To: Kashmira Patel (kupatel) <kupatel@cisco.com>; +Cc: pgsql-sql

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???
>
>
>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-12-27 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-27 19:52 Unable to drop table, error mentions "reltriggers" Kashmira Patel (kupatel) <kupatel@cisco.com>
2006-12-27 20:09 ` Shoaib Mir <shoaibmir@gmail.com>

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