From: | ohp(at)pyrenet(dot)fr |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Rick Gigger <rick(at)alpinenetworking(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: should I worry? |
Date: | 2007-11-06 11:24:29 |
Message-ID: | Pine.UW2.4.53.0711061220580.25836@sun.pyrenet |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, 5 Nov 2007, Tom Lane wrote:
> Date: Mon, 05 Nov 2007 15:53:10 -0500
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
> Cc: Rick Gigger <rick(at)alpinenetworking(dot)com>, ohp(at)pyrenet(dot)fr,
> pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] should I worry?
>
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
> > Rick Gigger wrote:
> >> Doesn't DROP TRIGGER require the name of the trigger? He says they are
> >> unnamed. How then does he drop them?
>
> > They're not really unnamed. pg_dump just replaces the real name with
> > "<unnamed>".
>
> And \d will show the real names of the triggers, so it's not really
> that hard to drop them:
>
> u=# \d t1
> Table "public.t1"
> Column | Type | Modifiers
> --------+---------+-----------
> f1 | integer | not null
> Indexes:
> "t1_pkey" PRIMARY KEY, btree (f1)
> Triggers:
> "RI_ConstraintTrigger_229629" AFTER DELETE ON t1 FROM t2 NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_del"('<unnamed>', 't2', 't1', 'UNSPECIFIED', 'f2', 'f1')
> "RI_ConstraintTrigger_229630" AFTER UPDATE ON t1 FROM t2 NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_upd"('<unnamed>', 't2', 't1', 'UNSPECIFIED', 'f2', 'f1')
>
> u=# drop trigger "RI_ConstraintTrigger_229629" on t1;
> DROP TRIGGER
>
> I do recall newbies forgetting to double-quote the mixed-case trigger
> names when this came up in times past, though.
>
> regards, tom lane
>
I'd love to find a query against pg_triggers giving the table name for
each RI_ConstraintTrigger_xxx.
That would be quick to delete them all instead of going through all
tables.
Regards,
--
Olivier PRENANT Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges +33-5-61-50-97-01 (Fax)
31190 AUTERIVE +33-6-07-63-80-64 (GSM)
FRANCE Email: ohp(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)
From | Date | Subject | |
---|---|---|---|
Next Message | Mark Mielke | 2007-11-06 13:01:16 | Re: Visibility map thoughts |
Previous Message | Jens-Wolfhard Schicke | 2007-11-06 11:07:04 | Re: Hash index todo list item |