Re: Manual Trigger Creation - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Manual Trigger Creation
Date
Msg-id web-26867@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Manual Trigger Creation  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Manual Trigger Creation
List pgsql-sql
Stephan,

> Yeah, it doesn't play nice with alter table at all. :(
> Actually, for recreating -- All you really need to do is kill the
> three triggers that it creates (drop trigger should work) and use
> alter table to add them again.

How can I drop them if they are <unnamed> triggers?  I've been doing
that by editing pg_trigger, but that just got me into a system table
mess that it took 2 hours to fix ... and lost me half my foriegn keys to
boot.

Is there, perhaps, a way I can name my constraints in the original
CREATE TABLE statement?  Aha! I see ... I never noticed the optional
[CONSTRAINT constraint_name] phrase before.  'S what I get for crossing
over from Transact-SQL without retraining!

> You could do this (4 is unnecessary and 3 and 5 can be combined),
> although
> I think you might be better off using alter table add constraint to
> do
> that.

I'm interested in the approach for another reason.  I have a number of
tables that must match a NON-UNIQUE value in a reference table, and thus
I'd like to test them against a query or view.

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Manual Trigger Creation
Next
From: Joseph Shraibman
Date:
Subject: count() and multiple tables