Re: RE: finding and removing a constraint... - Mailing list pgsql-general

From Brent R. Matzelle
Subject Re: RE: finding and removing a constraint...
Date
Msg-id 200103211631.f2LGVpt07050@mail.postgresql.org
Whole thread Raw
In response to finding and removing a constraint...  ("chris markiewicz" <cmarkiew@commnav.com>)
Responses Re: RE: finding and removing a constraint...
List pgsql-general
3/20/2001 6:18:23 AM, Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:
>> The problem is that the syntax
>>
>> create table SomeTable (
>> SomeColumn        int4 references OtherTable ( SomeColumn ),
>>  . . .
>>
>> creates an <unnamed> trigger which you can't drop with drop trigger
>> because it doesn't have a name. What you suggest does work for me, i.e.
>> deleting from pg_trigger and then adjusting the trigger count in
>> pg_class but it is quite cumbersome.
>
>You should be able to, you just have to use the *real* trigger name (first
>column in pg_trigger, will look like RI_ConstraintTrigger_<oid> or
>something like that) and make sure to "" it because it's a quoted mixed
>case name.

It might be even easier to just delete according to the oid.

select oid, * from pg_trigger;
delete from pg_trigger where oid = 49469 /* Numbers are easier */;

Brent

---
Brent R. Matzelle
Software Engineer
Information Services
Main Line Health Systems
Tel: 610-240-4566
Pager: 610-640-8437
matzelleb@mlhs.org



pgsql-general by date:

Previous
From: Karel Zak
Date:
Subject: Re: to_timestamp question
Next
From: "Brent R. Matzelle"
Date:
Subject: Re: Hope it is not too offtopic