pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
dropping constraints
2+ messages / 2 participants
[nested] [flat]

* dropping constraints
@ 2001-06-07 15:32 Linh Luong <linh.luong@computalog.com>
  2001-06-07 16:36 ` Re: dropping constraints Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Linh Luong @ 2001-06-07 15:32 UTC (permalink / raw)
  To: pgsql-sql

Hi,

Is there to drop a constraint when you add it separately with an alter
statement.
 
alter table failuretypecategory1 add constraint fk_failuretypecategory1
FOREIGN KEY (failurecategory1id)
  REFERENCES failurecategory1 (id) ON UPDATE CASCADE ON DELETE CASCADE;

I tried 
drop trigger <tgconstrname> on failurecategory1
and 
drop trigger <tgconstrname> on failuretypecategory1

and also

drop trigger <tgname> on failurecategory1
and 
drop trigger <tgname> on failuretypecategory1


But it kept saying 
ERROR:  DropTrigger: there is no trigger <tgname>/<tgconstrname> on
relation failuretypecategory1

What am I doing wrong.

I tried dropping the table also and when I tried to delete from a table
that it referenced above it gave the error that the table I just drop
doesn't exist.  Obviously because I just removed it but the constraint
it still there.. 

Thanks

-- 
Linh Luong



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

* Re: dropping constraints
  2001-06-07 15:32 dropping constraints Linh Luong <linh.luong@computalog.com>
@ 2001-06-07 16:36 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Stephan Szabo @ 2001-06-07 16:36 UTC (permalink / raw)
  To: Linh Luong <linh.luong@computalog.com>; +Cc: pgsql-sql


You probably need to make sure to double quote the tgname in your drops.

On Thu, 7 Jun 2001, Linh Luong wrote:

> Hi,
> 
> Is there to drop a constraint when you add it separately with an alter
> statement.
>  
> alter table failuretypecategory1 add constraint fk_failuretypecategory1
> FOREIGN KEY (failurecategory1id)
>   REFERENCES failurecategory1 (id) ON UPDATE CASCADE ON DELETE CASCADE;
> 
> I tried 
> drop trigger <tgconstrname> on failurecategory1
> and 
> drop trigger <tgconstrname> on failuretypecategory1
> 
> and also
> 
> drop trigger <tgname> on failurecategory1
> and 
> drop trigger <tgname> on failuretypecategory1
> 
> 
> But it kept saying 
> ERROR:  DropTrigger: there is no trigger <tgname>/<tgconstrname> on
> relation failuretypecategory1
> 
> What am I doing wrong.
> 
> I tried dropping the table also and when I tried to delete from a table
> that it referenced above it gave the error that the table I just drop
> doesn't exist.  Obviously because I just removed it but the constraint
> it still there.. 




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


end of thread, other threads:[~2001-06-07 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-07 15:32 dropping constraints Linh Luong <linh.luong@computalog.com>
2001-06-07 16:36 ` Stephan Szabo <sszabo@megazone23.bigpanda.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