postgresql_fdw doesn't handle defaults correctly - Mailing list pgsql-hackers

From Pavel Stehule
Subject postgresql_fdw doesn't handle defaults correctly
Date
Msg-id CAFj8pRD=YR91zhXDRYacLkDx=4k=v8eWKg7=bqdHbLQkRCpwjQ@mail.gmail.com
Whole thread Raw
Responses Re: postgresql_fdw doesn't handle defaults correctly
List 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

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Constraint documentation
Next
From: Chris Howard
Date:
Subject: comma to delimit fractional seconds