>>I'm getting this error when tring to remove a table from a database programmatically. How do I delete the relation in code so I can remove the table? This whole database container, back links, front links, belongs to crap is killing me. This routine was supposed to take about 4 hours and it's been 3 days. All I'm trying to do is copy a source database and tables using the COPY TO command and it's been a nightmare. Almost there, but everytime I think that, another one of these errors bites me in the patootie.
>>
>>
>>
>>Table "name" is referenced in a relation (Error 1577)You cannot remove a table from a database if that table is involved in a relation.
>>
>>Delete the relation first.
>>
>>
>
>you need
>
Alter table {table} DROP FOREIGN KEY TAG {tag name}
What if I don't know what the offending tag name is? And why does this come up as a relation error? I'm looping through a table of tables as I'm doing this. Do I now need to loop through every table for it's tags and delete them? This stuff is very frustrating.