Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y05JS-0001EX-Po for pgsql-sql@arkaria.postgresql.org; Sun, 14 Dec 2014 09:18:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y05JR-0006eZ-Lh for pgsql-sql@arkaria.postgresql.org; Sun, 14 Dec 2014 09:18:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y05JQ-0006eR-Fi for pgsql-sql@postgresql.org; Sun, 14 Dec 2014 09:18:00 +0000 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y05JN-0003wm-PV for pgsql-sql@postgresql.org; Sun, 14 Dec 2014 09:17:58 +0000 Received: by mail-qg0-f42.google.com with SMTP id q108so5316986qgd.1 for ; Sun, 14 Dec 2014 01:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=MskEX9zFWq2gWRRSrQB6k9kr+ytYRspA3+F/APv1ypk=; b=hxhHo73D6Kkc8T4A7KAJltTEO79lolTvVDy81bEC6RHGwoHu1rKl5jLBJfhMZtkMsm 1RseD28PnxHuz5tf+IFu9+scV7wMgQF2ja+uGn/eMGRnPQshAZVbCHEdiORY5unj0iS/ R92y0ZfP4D73YqUWZJQU0XXbIgCzdmwon3eb6spDaZjDP6FHv8SIgKN3CIA8jjqNN6An CE6S6aCrqIXl5p0tc/jIh/ux8ooDufIBTBUyRZPpDmB31Oj90y1AQ//aEwBMCXlRggr1 6gQJVIcODytbCqKmcovNUHYf4zuOaxSAcJ5gtYuqIcOTl5/HbGQafmYBlVbKIhSJicir q+QQ== X-Received: by 10.140.46.52 with SMTP id j49mr43754525qga.30.1418548676670; Sun, 14 Dec 2014 01:17:56 -0800 (PST) Received: from ?IPv6:2606:a000:a180:a100:d250:99ff:fe38:d0da? ([2606:a000:a180:a100:d250:99ff:fe38:d0da]) by mx.google.com with ESMTPSA id l93sm6983591qge.6.2014.12.14.01.17.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Dec 2014 01:17:56 -0800 (PST) Message-ID: <548D54C9.3040005@gmail.com> Date: Sun, 14 Dec 2014 04:13:45 -0500 From: Ed Rahn User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: foregin table insert error Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hi, I have a foreign table that I'm getting an insert error on: horsedata=# insert into remote_cache (entry_id, name_id) values(2,1); ERROR: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null, 1, 2, null). CONTEXT: Remote SQL command: INSERT INTO public.cache(id, name_id, entry_id, value) VALUES ($1, $2, $3, $4) Here is the remote table client side: horsedata=# \d remote_cache Foreign table "public.remote_cache" Column | Type | Modifiers | FDW Options ----------+---------+-----------+------------- id | integer | | name_id | integer | | entry_id | integer | | value | integer | | Server: home FDW Options: (table_name 'cache') And here's cache server side: horsedata=# \d cache; Table "public.cache" Column | Type | Modifiers ----------+------------------+---------------------------------------------------- id | integer | not null default nextval('cache_id_seq'::regclass) name_id | integer | entry_id | integer | value | double precision | Indexes: "cache_pkey" PRIMARY KEY, btree (id) "cache_name_id_entry_id_key" UNIQUE CONSTRAINT, btree (name_id, entry_id) "ix_cache_entry_id" btree (entry_id) "ix_cache_name_id" btree (name_id) Any suggestions? Thanks Ed -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql