JDBC_FDW icon indicating copy to clipboard operation
JDBC_FDW copied to clipboard

JDBC_FDW does not work with BIGINT match under JOIN clauses

Open brunosimioni opened this issue 11 years ago • 0 comments

-- foreign database CREATE TABLE foreign_table (id BIGSERIAL);

-- local database CREATE TABLE local_table (id BIGSERIAL, remote_id BIGSERIAL);

CREATE FOREIGN TABLE local_foreign_table ( id BIGINT ) SERVER aserver OPTIONS ( query ' SELECT id FROM foreign_table ');

-- local query SELECT local.id, local.remote_id, foreign.id FROM local_table as local, local_foreign_table as foreign WHERE local.remote_id = local_foreign_table.id

Problem: for several rows, JOIN operation only applies for the first one row in resultset. If we cast boths IDs (local.id and foreign.id) to Integer (instead of BigInt), all results are correct, the match occurs in all resultset.

brunosimioni avatar Jan 24 '14 17:01 brunosimioni