BUG #8657: Postgres 9.3 JDBC driver is unable to find the Foreign tables - Mailing list pgsql-bugs

From plalg@hotmail.com
Subject BUG #8657: Postgres 9.3 JDBC driver is unable to find the Foreign tables
Date
Msg-id E1VoLIx-0002Fs-SQ@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8657
Logged by:          Prakash Lal
Email address:      plalg@hotmail.com
PostgreSQL version: 9.3.0
Operating system:   Windows 7
Description:

Postgres 9.3 JDBC driver is unable to find the Foreign tables.


Found the cause, the hashmap values for "FOREIGN TABLE" in
AbstractJdbc2DatabaseMetaData class is getting overwritten by "MATERIALIZED
VIEW" values:


Before
        ht = new HashMap();
        tableTypeClauses.put("FOREIGN TABLE", ht);
        ht.put("SCHEMAS", "c.relkind = 'f'");
        ht.put("NOSCHEMAS", "c.relkind = 'f'");
        tableTypeClauses.put("MATERIALIZED VIEW", ht);
        ht.put("SCHEMAS", "c.relkind = 'm'");
        ht.put("NOSCHEMAS", "c.relkind = 'm'");




After (fix):
        ht = new HashMap();
        tableTypeClauses.put("FOREIGN TABLE", ht);
        ht.put("SCHEMAS", "c.relkind = 'f'");
        ht.put("NOSCHEMAS", "c.relkind = 'f'");
        ht = new HashMap(); // this is the line missing
        tableTypeClauses.put("MATERIALIZED VIEW", ht);
        ht.put("SCHEMAS", "c.relkind = 'm'");
        ht.put("NOSCHEMAS", "c.relkind = 'm'");


thanks
Prakash

pgsql-bugs by date:

Previous
From: maciek@heroku.com
Date:
Subject: BUG #8656: Duplicate data violating unique constraints
Next
From: Andres Freund
Date:
Subject: Re: BUG #8656: Duplicate data violating unique constraints