Re: Error of insert Foreign table with postgres_fdw

From: Jaimin Pan <jaimin(dot)pan(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Error of insert Foreign table with postgres_fdw
Date: 2017-08-08 06:53:43
Message-ID: CABP8UDRTyZwYcT0bmQVvrhqZwUazUaatvSF83z=15u2WXmpPKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks Tom. Add the schema "public" in trigger solve my question.

2017-08-07 21:19 GMT+08:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Jaimin Pan <jaimin(dot)pan(at)gmail(dot)com> writes:
> > I got error when insert a parent table by inserting a foreign table.
> > ...
> > (create trigger "phone_pool_insert_trigger" for phone_pool and insert
> into
> > phone_pool works well. The child table got the row.)
>
> > when insert into phone_pool_foreign. I got error like following.
> > 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
> > """
>
> You didn't show us either the whole trigger or the failing statement in
> it, but I bet you forgot to schema-qualify the child table names.
> postgres_fdw runs the remote session with a very restrictive search_path,
> just pg_catalog if memory serves. It's generally bad practice for
> triggers to rely on the prevailing search path in any case.
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message alain bourgeois 2017-08-08 08:14:11 Re: BUG #14772: psql autocommit does not work
Previous Message kyle 2017-08-08 06:09:05 BUG #14773: Incorrect documentation for the Relation logical replication message format