pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Najm Hashmi <najm@mondo-live.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Correct Syntax for alter table ..add constraint
Date: Fri, 19 Jan 2001 11:30:12 -0800
Message-ID: <web-1179538@davinci.ethosmedia.com> (raw)
In-Reply-To: <3A69DDA0.610029E6@mondo-live.com>

Najm,

> references age_list(id);
> And I get the following error:
> flipr=# alter table users
> flipr-# add constraint age_fk foreign key(age) references
> age_list(id);
> NOTICE:  ALTER TABLE ... ADD CONSTRAINT will create
> implicit trigger(s)
> for FOREIGN KEY check(s)
> ERROR:  <unnamed> referential integrity violation - key
> referenced from
> users not found in age_list

Simple ... you have values in the AGE column that are not in
the age_list table.  Thus you're in violation of the foriegn
key you're trying to establish.

-Josh Berkus



view thread (3+ messages)  latest in thread

Message-ID: <web-1179538@davinci.ethosmedia.com>
Permalink:  ../web-1179538@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1179538@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, najm@mondo-live.com
  Subject: Re: Correct Syntax for alter table ..add constraint
  In-Reply-To: <web-1179538@davinci.ethosmedia.com>
  References: <3A69DDA0.610029E6@mondo-live.com> <web-1179538@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