postgresql_fdw doesn't handle defaults correctly

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: postgresql_fdw doesn't handle defaults correctly
Date: 2018-06-23 17:23:08
Message-ID: CAFj8pRD=YR91zhXDRYacLkDx=4k=v8eWKg7=bqdHbLQkRCpwjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I have a table boo

create table boo(id serial primary key, inserted date default current_date,
v varchar);

I imported this table via simple

IMPORT FOREIGN SCHEMA public FROM SERVER foreign_server INTO public;

The command insert into boo(v) values('ahoj'); is working in original
database, but in second database with foreign table this fails

postgres=# insert into boo(v) values('ahoj');
ERROR: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, null, ahoj).
CONTEXT: remote SQL command: INSERT INTO public.boo(id, inserted, v)
VALUES ($1, $2, $3)

It does unwanted transformation to insert of all columns.

Is it expected behave?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Howard 2018-06-23 18:13:21 comma to delimit fractional seconds
Previous Message Fabien COELHO 2018-06-23 17:15:35 Re: Constraint documentation