pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kyle <kyle@actarg.com>
To: Bryan Field-Elliot <bryan@netmeme.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: "drop constraint trigger" on PostgreSQL
Date: Fri, 08 Dec 2000 16:35:21 -0700
Message-ID: <3A317038.CBE9B378@actarg.com> (raw)
References: <01c401c0615a$dc2ad780$54ed90cc@netmeme.org>

Bryan Field-Elliot wrote:

> Searching the archives, it seems you once tried to find out how to
> "drop constraint trigger" on PostgreSQL; did you ever figure it
> out? Thank you,Bryan

I wrote the following function and installed it in my database.  I can
then call it with a select (yuk) to drop a constraint trigger:

-- Drop all constraint triggers with a given constraint name
-- calling sequence: drop_contrig(constrname)
create function drop_contrig(text) returns text as '
    set d(tgname) {}
    spi_exec -array d "select c.relname,t.tgname from pg_class c,
pg_trigger t where c.oid = t.tgrelid and tgconstrname = \'$1\'" {
        spi_exec "drop trigger \\"$d(tgname)\\" on $d(relname)"
    }
    if {$d(tgname) == {}} {return "No constraint trigger $1 found"}
    return "Drop trigger $d(tgname) on $d(relname)"
    ' LANGUAGE 'pltcl';

Attachments:

kyle.vcf (text/x-vcard, 184B) download begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard

Message-ID: <3A317038.CBE9B378@actarg.com>
Permalink:  ../3A317038.CBE9B378@actarg.com/
Also on:    postgresql.org/message-id/3A317038.CBE9B378@actarg.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: kyle@actarg.com, bryan@netmeme.org
  Subject: Re: "drop constraint trigger" on PostgreSQL
  In-Reply-To: <3A317038.CBE9B378@actarg.com>
  References: <01c401c0615a$dc2ad780$54ed90cc@netmeme.org> <3A317038.CBE9B378@actarg.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