Re: The PostgreSQl 9.3 JDBC driver fails to find foreign tables

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: plalg <plalg(at)hotmail(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: The PostgreSQl 9.3 JDBC driver fails to find foreign tables
Date: 2013-12-04 14:48:48
Message-ID: CADK3HHJn91EyuR4iD1Mrw6XEt-0LHo7Q-HF1cgpKNvJh_sn2ag@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thanks for finding this, and providing the fix!

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Tue, Dec 3, 2013 at 11:44 PM, plalg <plalg(at)hotmail(dot)com> wrote:

> 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'");
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/The-PostgreSQl-9-3-JDBC-driver-fails-to-find-foreign-tables-tp5781549p5781563.html
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andrew Gaul 2013-12-04 19:37:57 JDBC lint
Previous Message plalg 2013-12-04 04:44:41 Re: The PostgreSQl 9.3 JDBC driver fails to find foreign tables