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

* dropping foreign key
@ 2001-10-23 21:58  Joseph Shraibman <jks@selectacast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Joseph Shraibman @ 2001-10-23 21:58 UTC (permalink / raw)
  To: pgsql-sql

I have to drop a froeign key from one of my tables.  The problem is that I have another 
table that has a foreign key on the first one, so I can't do the select to temp-table 
thing and move it back.

Is there any way I can remove it by mucking with pg's internal tables?

-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com




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

* Re: dropping foreign key
@ 2001-10-24 05:04  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Joseph Shraibman <jks@selectacast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Stephan Szabo @ 2001-10-24 05:04 UTC (permalink / raw)
  To: Joseph Shraibman <jks@selectacast.net>; +Cc: pgsql-sql


On Tue, 23 Oct 2001, Joseph Shraibman wrote:

> I have to drop a froeign key from one of my tables.  The problem is that I have another 
> table that has a foreign key on the first one, so I can't do the select to temp-table 
> thing and move it back.
> 
> Is there any way I can remove it by mucking with pg's internal tables?

Yeah.  All you should need to do is remove the three triggers that
were created for the constraint (1 on the fk table, 2 on the pk table).
You can find them in pg_trigger and you'll need to double quote the 
names for the drop trigger statements because they're mixed case.





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

* Re: dropping foreign key
@ 2001-10-24 21:12  Joseph Shraibman <jks@selectacast.net>
  parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Joseph Shraibman @ 2001-10-24 21:12 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-sql

Can I just set  tgenabled to false?

Stephan Szabo wrote:

> On Tue, 23 Oct 2001, Joseph Shraibman wrote:
> 
> 
>>I have to drop a froeign key from one of my tables.  The problem is that I have another 
>>table that has a foreign key on the first one, so I can't do the select to temp-table 
>>thing and move it back.
>>
>>Is there any way I can remove it by mucking with pg's internal tables?
>>
> 
> Yeah.  All you should need to do is remove the three triggers that
> were created for the constraint (1 on the fk table, 2 on the pk table).
> You can find them in pg_trigger and you'll need to double quote the 
> names for the drop trigger statements because they're mixed case.
> 
> 


-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com




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

* Re: dropping foreign key
@ 2001-10-24 21:55  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Joseph Shraibman <jks@selectacast.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Stephan Szabo @ 2001-10-24 21:55 UTC (permalink / raw)
  To: Joseph Shraibman <jks@selectacast.net>; +Cc: pgsql-sql


On Wed, 24 Oct 2001, Joseph Shraibman wrote:

> Can I just set  tgenabled to false?

I'm not sure if it works now (in 7.2 devel) but I'm pretty
sure that doesn't work in past versions unfortunately.




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


end of thread, other threads:[~2001-10-24 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-23 21:58 dropping foreign key Joseph Shraibman <jks@selectacast.net>
2001-10-24 05:04 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-10-24 21:12   ` Joseph Shraibman <jks@selectacast.net>
2001-10-24 21:55     ` 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