Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 11:19 GMT+02:00 Pavel Stehule : > > > 2018-06-27 11:12 GMT+02:00 Pavel Stehule : > >> >> >> 2018-06-27 9:30 GMT+02:00 Amit Langote : >> >>> On 2018/06/27 15:59, Pavel Stehule wrote: >>> > 2018-06-27 8:45 GMT+02:00 Amit Langote >> >: >>> >> On 2018/06/27 15:33, Pavel Stehule wrote: >>> >

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 11:12 GMT+02:00 Pavel Stehule : > > > 2018-06-27 9:30 GMT+02:00 Amit Langote : > >> On 2018/06/27 15:59, Pavel Stehule wrote: >> > 2018-06-27 8:45 GMT+02:00 Amit Langote : >> >> On 2018/06/27 15:33, Pavel Stehule wrote: >> >>> I don't understand, why is necessary to replace missing valu

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 9:30 GMT+02:00 Amit Langote : > On 2018/06/27 15:59, Pavel Stehule wrote: > > 2018-06-27 8:45 GMT+02:00 Amit Langote : > >> On 2018/06/27 15:33, Pavel Stehule wrote: > >>> I don't understand, why is necessary to replace missing values by > NULLs? > >>> > >>> I didn't expect so insert in

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Amit Langote
On 2018/06/27 15:59, Pavel Stehule wrote: > 2018-06-27 8:45 GMT+02:00 Amit Langote : >> On 2018/06/27 15:33, Pavel Stehule wrote: >>> I don't understand, why is necessary to replace missing values by NULLs? >>> >>> I didn't expect so insert into foo(c) values(10) >>> >>> will be translated to >>> >

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-27 Thread Pavel Stehule
2018-06-27 8:45 GMT+02:00 Amit Langote : > On 2018/06/27 15:33, Pavel Stehule wrote: > >>> Unfortunately, when I use identity column > >>> > >>> create table foo(a int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, b > >> date > >>> default current_date, c int); > >>> > >>> then import doesn't fail

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-26 Thread Amit Langote
On 2018/06/27 15:33, Pavel Stehule wrote: >>> Unfortunately, when I use identity column >>> >>> create table foo(a int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, b >> date >>> default current_date, c int); >>> >>> then import doesn't fail, but still it doesn't work >> >> It seems that, unlike DE

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-26 Thread Pavel Stehule
2018-06-27 8:28 GMT+02:00 Amit Langote : > On 2018/06/27 2:47, Pavel Stehule wrote: > > 2018-06-25 4:30 GMT+02:00 Amit Langote : > >> 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

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-26 Thread Amit Langote
On 2018/06/27 2:47, Pavel Stehule wrote: > 2018-06-25 4:30 GMT+02:00 Amit Langote : >> 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

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-26 Thread Pavel Stehule
Hi 2018-06-25 4:30 GMT+02:00 Amit Langote : > 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 SC

Re: postgresql_fdw doesn't handle defaults correctly

2018-06-24 Thread Amit Langote
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 mis

postgresql_fdw doesn't handle defaults correctly

2018-06-23 Thread Pavel Stehule
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, b