Re: postgresql_fdw doesn't handle defaults correctly

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresql_fdw doesn't handle defaults correctly
Date: 2018-06-25 02:30:43
Message-ID: e7e183b3-9088-4d16-ad09-a268d901b8dc@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

On 2018/06/24 2:23, Pavel Stehule wrote:
> 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;

It seems you missed using OPTIONS (import_default 'true') here.

create schema foo;
create table foo.foo (a serial primary key, b date default current_date
not null, c int);

import foreign schema foo from server loopback into public options
(import_default 'true');

insert into public.foo (c) values (1);
select * from public.foo;
a | b | c
---+------------+---
1 | 2018-06-25 | 1
(1 row)

insert into foo.foo (c) values (2);
select * from public.foo;
a | b | c
---+------------+---
1 | 2018-06-25 | 1
2 | 2018-06-25 | 2
(2 rows)

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-06-25 02:33:59 Re: Supporting tls-server-end-point as SCRAM channel binding for OpenSSL 1.0.0 and 1.0.1
Previous Message Michael Paquier 2018-06-25 02:26:14 Re: Incorrect errno used with %m for backend code