Error of insert Foreign table with postgres_fdw

From: Jaimin Pan <jaimin(dot)pan(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Error of insert Foreign table with postgres_fdw
Date: 2017-08-07 07:45:16
Message-ID: CABP8UDQ+vCLTjpjCiK0F=ykp7Rc3nXVUWsiYafqkrp=u4Ypzfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi all,

I got error when insert a parent table by inserting a foreign table.
Environment is following:
PG 9.6.3
CentOS6

step 1.
database1: create one parent table: phone_pool, 100 inherits table: ph_xx.
phone_pool
ph_0
...
ph_99
(create trigger "phone_pool_insert_trigger" for phone_pool and insert into
phone_pool works well. The child table got the row.)

step 2:
database2:
create foreign table phone_pool_foreign for phone_pool in database1.
when insert into phone_pool_foreign. I got error like following.
"""
insert into
phone_pool_foreign(id,patrition,phone,carrier,createtime,updatetime,deleteflg)
SELECT
'35A88C4B06B3', '90', '133333330', '1', to_date('2017-08-07
11:57:33.398','yyyy-mm-dd hh24:mi:ss'), to_date('2017-08-07
11:57:33.398','yyyy-mm-dd hh24:mi:ss'), 1;

ERROR: relation "ph_90" does not exist
CONTEXT: Remote SQL command: INSERT INTO public. phone_pool_foreign(id,
patrition, phone, carrier, createtime, updatetime, deleteflg) VALUES ($1,
$2, $3, $4, $5, $6, $7)
PL/pgSQL function public.phone_pool_insert_trigger() line 93 at SQL
statement
"""

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hillel.eilat 2017-08-07 12:20:30 BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATE TABLE" command
Previous Message Tom Lane 2017-08-06 22:17:17 Re: Replication to Postgres 10 on Windows is broken