Re: BUG #18690: A count function returns wrong value when using FDW - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18690: A count function returns wrong value when using FDW
Date
Msg-id 3243407.1730906971@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18690: A count function returns wrong value when using FDW  (Aidar Uldanov <aidar@donorbox.org>)
Responses Re: BUG #18690: A count function returns wrong value when using FDW
List pgsql-bugs
Aidar Uldanov <aidar@donorbox.org> writes:
> David, after some troubleshooting I found out that the issue with FWD and
> bigint values, so when column type int then it works well but after
> changing to a bigint type a count() function returns the wrong value.

>  create table transactions(
>   id serial primary key,
>   amount int,
>   org_id int,
>   recurring_payment_id int REFERENCES recurring_payments(id)
>  );
> ...
> CREATE FOREIGN TABLE transactions_f (
>     id serial,
>   amount bigint,
>   org_id int,
>   recurring_payment_id int
> )
> SERVER foreign_server
> OPTIONS (schema_name 'public', table_name 'transactions');

While it's sort of interesting that that misbehaves, I do not believe
that postgres_fdw promises to work correctly with foreign-table
definitions that don't match the remote table's actual column
datatypes.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Aidar Uldanov
Date:
Subject: Re: BUG #18690: A count function returns wrong value when using FDW
Next
From: Aidar Uldanov
Date:
Subject: Re: BUG #18690: A count function returns wrong value when using FDW