pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Manual Trigger Creation
Date: Mon, 19 Mar 2001 15:34:29 -0800
Message-ID: <web-26867@davinci.ethosmedia.com> (raw)
In-Reply-To: <Pine.BSF.4.21.0103191455110.26703-100000@megazone23.bigpanda.com>

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 information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (5+ messages)  latest in thread

Message-ID: <web-26867@davinci.ethosmedia.com>
Permalink:  ../web-26867@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-26867@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, sszabo@megazone23.bigpanda.com
  Subject: Re: Manual Trigger Creation
  In-Reply-To: <web-26867@davinci.ethosmedia.com>
  References: <Pine.BSF.4.21.0103191455110.26703-100000@megazone23.bigpanda.com> <web-26867@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox