Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0ACN-0001ub-R6 for pgsql-sql@arkaria.postgresql.org; Sun, 14 Dec 2014 14:31:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y0ACN-0001f8-BN for pgsql-sql@arkaria.postgresql.org; Sun, 14 Dec 2014 14:31:03 +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 1Y0ACK-0001ex-OR for pgsql-sql@postgresql.org; Sun, 14 Dec 2014 14:31:01 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y0ACC-00010n-IC for pgsql-sql@postgresql.org; Sun, 14 Dec 2014 14:30:58 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3E02F208E2 for ; Sun, 14 Dec 2014 09:30:51 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 14 Dec 2014 09:30:51 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= x-sasl-enc:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=BwYg/sR1ndFA/wOH57WX5xQbIA4=; b=OenloV5S7qX0X7XgbG Egvh9dc15YHb+6bA5bAE3P3ku09ZJR7F5qXHMOUK1VorMnUis81NRFFyfJKtY7hK DRz3LI/IQxKteA3bpM0MGq0hfU2KUgtDxh5USOBaYr+1cBM6hj0pmQ8fXpQh5VFE gckHq+j5wuKtSFx8urectjfYo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=BwYg/sR1ndFA/wOH57WX5x QbIA4=; b=HXIXlF0+xWXZTezW6Uv4evIcPnKWqEh+VYwdvjDMaPvh9MGtsoO/Ec +M1ZD/UJtwfBB6F9KGd9uRm0cmCSiKGljxHsfKKDIr9cWiGDQHkbgiyoAEDDYJIK AFKn7UeDa1jc9w8fh5FXqo0erCCH0f9o55Ss9cf51O7g2Y864u6Pc= X-Sasl-enc: y/UeS/q4Bj/okl+Ieq7Hg9HtwrU+CBN6h9ubrGwQ0rem 1418567450 Received: from [192.168.1.2] (unknown [174.21.228.52]) by mail.messagingengine.com (Postfix) with ESMTPA id 96FA3C00280; Sun, 14 Dec 2014 09:30:50 -0500 (EST) Message-ID: <548D9F19.9080405@aklaver.com> Date: Sun, 14 Dec 2014 06:30:49 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Ed Rahn , pgsql-sql@postgresql.org Subject: Re: foregin table insert error References: <548D54C9.3040005@gmail.com> In-Reply-To: <548D54C9.3040005@gmail.com> 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 On 12/14/2014 01:13 AM, Ed Rahn wrote: > 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? Yes, see here: http://www.postgresql.org/message-id/CA+mi_8bfkaFPNPPx6_W_T_0J9OEMSfXQKCDZo=OMJpWWcCKtoA@mail.gmail.com > > Thanks > Ed > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql