dropping foreign key
dropping foreign key
От:
Joseph Shraibman <jks@selectacast.net>
Дата:
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
Re: dropping foreign key
От:
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Дата:
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.
Re: dropping foreign key
От:
Joseph Shraibman <jks@selectacast.net>
Дата:
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