pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aidar Uldanov <aidar@donorbox.org>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18690: A count function returns wrong value when using FDW
Date: Wed, 06 Nov 2024 10:29:31 -0500
Message-ID: <3243407.1730906971@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOCMfz=GKA+90BC0LXyuGYPeTT5u1mF_aVxXHHBpG+zBfL_Y=g@mail.gmail.com>
References: <18690-cbb98b56ecb0b130@postgresql.org>
	<CAApHDvoMwifCTZ6SgokRH49R-3MK5WYzBb+cwjvwb=RKpJOATw@mail.gmail.com>
	<CAOCMfz=ssk6L42p2KAH+wHyNAxV0B75uDrCaBveoX5zwrWc95w@mail.gmail.com>
	<CAOCMfz=GKA+90BC0LXyuGYPeTT5u1mF_aVxXHHBpG+zBfL_Y=g@mail.gmail.com>

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





view thread (6+ messages)  latest in thread

Message-ID: <3243407.1730906971@sss.pgh.pa.us>
Permalink:  ../3243407.1730906971@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3243407.1730906971@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, aidar@donorbox.org, dgrowleyml@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18690: A count function returns wrong value when using FDW
  In-Reply-To: <3243407.1730906971@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox