From: | "Dan Langille" <dan(at)langille(dot)org> |
---|---|
To: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
Cc: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: removing duplicated constraints |
Date: | 2002-03-02 21:42:29 |
Message-ID: | 200203022142.g22LgWk55334@lists.unixathome.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On 2 Mar 2002 at 11:09, Stephan Szabo wrote:
> On Sat, 2 Mar 2002, Dan Langille wrote:
>
> > On 2 Mar 2002 at 10:19, Dan Langille wrote:
> >
> > > CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER INSERT OR UPDATE ON "ports"
> > > FROM "categories" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW
> > > EXECUTE PROCEDURE "RI_FKey_check_ins" ('<unnamed>', 'ports',
> > > 'categories', 'UNSPECIFIED', 'category_id', 'id');
> > >
> > > CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER INSERT OR UPDATE ON "ports"
> > > FROM "categories" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW
> > > EXECUTE PROCEDURE "RI_FKey_check_ins" ('<unnamed>', 'ports',
> > > 'categories', 'UNSPECIFIED', 'category_id', 'id');
> >
> > How is an unnamed trigger deleted? During a dump, I can find information
> > such as this:
>
> The "<unnamed>" is the constraint name given. It also gets a trigger name
> (see system table pg_trigger) which you can use with DROP TRIGGER (although
> in the case of the fk constraint triggers you need to double quote the
> name).
I found the list of duplicate constraints by eyeballing the files I
created using the methods mentioned in previous post (mainly grep and
sort). Then I would search in the original dump file for the the CREATE
CONSTRAINT statement. Using the name found there
(RI_ConstraintTrigger_998199), I did this:
drop TRIGGER "RI_ConstraintTrigger_998189" on categories;
Making sense?
--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/ - practical examples
From | Date | Subject | |
---|---|---|---|
Next Message | Trapper | 2002-03-03 01:14:20 | Solaris x86 vs Linux vs *BSD for PostgreSQL? |
Previous Message | Stephan Szabo | 2002-03-02 19:09:11 | Re: removing duplicated constraints |