pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Najm Hashmi <najm@mondo-live.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Correct Syntax for alter table ..add constraint
Date: Sat, 20 Jan 2001 14:50:00 -0500
Message-ID: <3A69EBE8.D309714D@mondo-live.com> (raw)
References: <web-1179538@davinci.ethosmedia.com>

Josh Berkus wrote:

> 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

HI  Josh,
All values in age column of  are null..... I have no value there......
and I have specified to accetp nulls i.e.  I dont have constraint not
null on this particular column...
Najm




view thread (3+ messages)

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