Re: RE: finding and removing a constraint...

Поиск
Список
Период
Сортировка
От Frank Joerdens
Тема Re: RE: finding and removing a constraint...
Дата
Msg-id 20010320230040.A22215@rakete.joerdens.de
обсуждение исходный текст
Ответ на Re: RE: finding and removing a constraint...  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: RE: finding and removing a constraint...  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
On Tue, Mar 20, 2001 at 01:41:22PM -0800, Stephan Szabo wrote:
> On Tue, 20 Mar 2001, chris markiewicz wrote:
>
> > okay, i screwed up.  i dropped some triggers from a table.  now that table
> > is not accessible to me.
> >
> > can't drop it...can't select...can't pg_dump.
> >
> > message is error: RelationBuildTriggers: 2 record(s) not found for rel
> > accessor_group
> >
> > or a pg_dump results in: getTables(): relation 'accessor_group': 6 Triggers
> > were expected, but got 4.
> >
> > is there any way that i can re-insert them?
> >
> > if i'm screwed, then how do i drop this table?
>
> Okay... (you should really use drop trigger, not deleting from
> pg_trigger).

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.

The lesson here seems to be: Either have you schema so well thought
through that you don't need to mess with triggers created in the above
fashion once you have them in place, or make sure that all the FK
references you create are named.

Regards, Frank

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: RE: finding and removing a constraint...
Следующее
От: Joseph Koenig
Дата:
Сообщение: Really Dumb Question...(Dumping db)