pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gunce orman <gunceorman@gmail.com>
To: pgsql-admin@postgresql.org
Subject: foreign key violation error with partitioned table
Date: Thu, 6 Sep 2007 11:49:59 +0300
Message-ID: <8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.com> (raw)

hello,

i have a partitioned table t_kayit with  6 partitions and kayit_id is
primary key on this table. My other t_vto_sonuclari table use that kayit_id
as foreign key. I'm trying to insert  values which contains kayit_id to
t_vto_sonuclari and i'm sure those  kayit_ids are   in t_kayit table but
when i'm inserting , i had  error.

ERROR:  insert or update on table "t_vto_sonuclari" violates foreign key
constraint "fk_t_kayit_kayit_id"
DETAIL:  Key(kayit_id)=(54168) is not present in table t_kayit


I created a new test table which is as same  as t_kayit but non partitioned
. I create new foreign key on that t_vto_sonuclari which refers to the new
test table.  In that case i didn't had that error.I could insert. what am i
supposed to do for partitioned table?

view thread (2+ messages)  latest in thread

Message-ID: <8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.com>
Permalink:  ../8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.com/
Also on:    postgresql.org/message-id/8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gunceorman@gmail.com
  Subject: Re: foreign key violation error with partitioned table
  In-Reply-To: <8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.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