atris / JDBC_FDW

FDW that wraps JDBC for PostgreSQL.It can be used to connect and fetch data from any data source that supports JDBC
Other
67 stars 38 forks source link

JDBC_FDW does not work with BIGINT match under JOIN clauses #14

Open brunosimioni opened 10 years ago

brunosimioni commented 10 years ago

-- 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.