Обсуждение: Can't get rid of constraint

Поиск
Список
Период
Сортировка

Can't get rid of constraint

От
Matthew Price
Дата:
Howdy,
I had a table in my database that reference another like:

create table a (1 int, 2 int);
create table b (1 int references a(1));

recently i had to do a:
drop table b;

now i can't:
delete from a where 1='5';

because i get:
ERROR:  Relation 'b' does not exist

How do I get rid of this zombie constraint?

Thanks,
Matthew




________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.


Re: Can't get rid of constraint

От
Stephan Szabo
Дата:
On Thu, 28 Feb 2002, Matthew Price wrote:

> Howdy,
> I had a table in my database that reference another like:
>
> create table a (1 int, 2 int);
> create table b (1 int references a(1));
>
> recently i had to do a:
> drop table b;
>
> now i can't:
> delete from a where 1='5';
>
> because i get:
> ERROR:  Relation 'b' does not exist
>
> How do I get rid of this zombie constraint?

There are two triggers on a that do the constraint, if you
drop the triggers with drop trigger (you'll need to double
quote the names) you should be fine.