pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Ellis <Tim.Ellis@gamet.com>
To: pgsql-admin@postgresql.org
Subject: Constraints/Triggers information?
Date: Thu, 27 Jun 2002 16:13:32 -0700
Message-ID: <20020627161332.765f5c04.Tim.Ellis@gamet.com> (raw)

I've got a snipped script like thus:

---------------------------------------------------
alter table license drop constraint fk_lic_lc restrict ;
drop table license ;
create table license (
  id numeric(18),
 . . .
) ;
alter table license add constraint fk_lic_lc
  foreign key (license_code_id) references license_code (id) ;
---------------------------------------------------

Where the final statement had previously run successfully:

---------------------------------------------------
psql:file.sql:284: NOTICE:
  ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
---------------------------------------------------

The initial statement (alter table drop constraint) always fails with

---------------------------------------------------
psql:file.sql:22: ERROR:  ALTER TABLE / DROP CONSTRAINT:
  fk_lic_lc does not exist
---------------------------------------------------

I can find nothing in psql's "\?" that talks about either triggers or
referential integrity constraints. Doing a "\d license" shows me several
RI entries like thus:

---------------------------------------------------
Triggers: RI_ConstraintTrigger_5602314,
          RI_ConstraintTrigger_5602320,
          RI_ConstraintTrigger_5602326
---------------------------------------------------

But I can't get any information on the RI_ entries. What's wrong with me?
Do I need to RTFM? If so, which FM do I need to R?

--
Tim Ellis
DBA, Gamet

ps -- doing drop constraint with cascade keyword gives me:
---------------------------------------------------
psql:file.sql:22: ERROR:  ALTER TABLE / DROP CONSTRAINT
  does not support the CASCADE keyword
---------------------------------------------------





view thread (2+ messages)  latest in thread

Message-ID: <20020627161332.765f5c04.Tim.Ellis@gamet.com>
Permalink:  ../20020627161332.765f5c04.Tim.Ellis@gamet.com/
Also on:    postgresql.org/message-id/20020627161332.765f5c04.Tim.Ellis@gamet.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-admin@postgresql.org
  Cc: Tim.Ellis@gamet.com
  Subject: Re: Constraints/Triggers information?
  In-Reply-To: <20020627161332.765f5c04.Tim.Ellis@gamet.com>
  References: <20020627161332.765f5c04.Tim.Ellis@gamet.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