Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D009F9F9A20 for ; Thu, 6 Sep 2007 05:50:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 16506-06 for ; Thu, 6 Sep 2007 05:49:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.188]) by postgresql.org (Postfix) with ESMTP id BFB939F9A14 for ; Thu, 6 Sep 2007 05:50:00 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so97398fka for ; Thu, 06 Sep 2007 01:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=R5a6YNnn+YgDrGS/N4w51S5tctN8Wq0DYdxantbUdJg=; b=X1H5xTJHOCzzRDQ3QJYkoXlzGDuC53yR6o5D6yXRtJJfZVRpDPntVhvARvQWHBtJU1FeY7nJkhE7CdfViY6vmn3TBGezaZjXd4YOCPHyPfi5phkOmIaMUBBj4RbBZhmCKQoRawPuCsQg9ukAkv4p0+wQk2kXuSTmiLdjOG9xdFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=aUJm4fCHC6MJjmwPQRFIKYIU5bLtea+92FPBRGujQMT3eSk6U1xKgFqPEqb82eZ4qd2xlJnXWFQc8/FiNDti4QhEIbHYMGDkjOqi9jWM+yjy42wMT/MLQVfAIbbUFxxMvUFP1DthZR5XOJRQMUmXjxKURSTMcsj8610RmLSZBtM= Received: by 10.82.175.17 with SMTP id x17mr807799bue.1189068599039; Thu, 06 Sep 2007 01:49:59 -0700 (PDT) Received: by 10.82.105.17 with HTTP; Thu, 6 Sep 2007 01:49:59 -0700 (PDT) Message-ID: <8e643fe60709060149x63704cf9p9f8a881cf3ce98f9@mail.gmail.com> Date: Thu, 6 Sep 2007 11:49:59 +0300 From: "gunce orman" To: pgsql-admin@postgresql.org Subject: foreign key violation error with partitioned table MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_26161_26257174.1189068599018" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/32 X-Sequence-Number: 26793 ------=_Part_26161_26257174.1189068599018 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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? ------=_Part_26161_26257174.1189068599018 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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?
------=_Part_26161_26257174.1189068599018--