pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: "????? ???????? |Vadim Zhernovoi|" <vadim.zhernovoi@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with FOREIGN KEY
Date: Tue, 22 Apr 2008 12:01:42 -0400
Message-ID: <20080422120142.c87d8f04.darcy@druid.net> (raw)
In-Reply-To: <509ab3740804220826l685baaa3x1bd9cc4bd2a08f1@mail.gmail.com>
References: <509ab3740804220826l685baaa3x1bd9cc4bd2a08f1@mail.gmail.com>

On Tue, 22 Apr 2008 18:26:19 +0300
"????? ???????? |Vadim Zhernovoi|" <vadim.zhernovoi@gmail.com> wrote:
> I have a Problem with Foreign key query...i've posted the code on
> http://pgsl.privatepaste.com/e44p3Orqiq, so it have syntax higlight.
> Please, need help!

That message is not telling you the the referenced table doesn't have
the field.  It is saying that the referenced table does not have a
matching row for one or more rows in the table being checked.  In other
words it is checking your existing data exactly the same as it will
check new data that you insert.  Your database is already violating the
rule that you are trying to enforce with the new constraint.

Also, I am pretty sure that you do not want the constraint
FK1_SecurityRolePermission that you created on SecurityRole.  What do
you think that will accomplish?

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (3+ messages)

Message-ID: <20080422120142.c87d8f04.darcy@druid.net>
Permalink:  ../20080422120142.c87d8f04.darcy@druid.net/
Also on:    postgresql.org/message-id/20080422120142.c87d8f04.darcy@druid.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, vadim.zhernovoi@gmail.com
  Subject: Re: Problem with FOREIGN KEY
  In-Reply-To: <20080422120142.c87d8f04.darcy@druid.net>

* 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