From: the6campbells <the6campbells@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: getTables not returning 10 columns etc
Date: Thu, 8 Dec 2011 19:17:26 -0800 (PST)
Message-ID: <ea56f9bc-e7a2-4b40-8eeb-8cd0b689599c@y6g2000prc.googlegroups.com> (raw)
References: <c5c35d9f-3a26-4ac4-bb57-b02f390196ab@v24g2000prn.googlegroups.com>
<CADK3HHJfjz398zbbL2zZKRtiz1A6boez=U5mHXPDG8EhCMi==g@mail.gmail.com>
On Dec 8, 9:47 pm, p...@fastcrypt.com (Dave Cramer) wrote:
> On Thu, Dec 8, 2011 at 8:10 PM, the6campbells <the6campbe...@gmail.com> wrote:
> > Is there any documentation that list for the all get* methods etc
> > where it is by design intent that the PG JDBC driver may not have a
> > result set with all the columns as documented in the JDBC docs?
>
> > For example getTables has 10 columns and the PG driver returns 5 or
> > the documentation uses upper case names such as TABLE_CAT but PG
> > driver returns lower case names etc.
>
> Which documentation ? By default postgres uses lower case names.
>
> You would have to provide a test case for use to diagnose this further.
>
>
>
> > --
> > Sent via pgsql-jdbc mailing list (pgsql-j...@postgresql.org)
> > To make changes to your subscription:
> >http://www.postgresql.org/mailpref/pgsql-jdbc
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-j...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-jdbc
re documentation
http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html
re example
Server: 9.0.4 Driver: PostgreSQL Native Driver: PostgreSQL 9.1 JDBC3
(build 901)
ResultSet rs = meta.getTables(null, null, null, null);
ResultSetMetaData rsmd = rs.getMetaData();
System.out.println(rsmd.getColumnCount());
This will print the value of 5 not 10.
Change the code to
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
System.out.println(rsmd.getColumnName(i));
}
http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,
java.lang.String, java.lang.String, java.lang.String[])
returns names as follows was expecting upper case names similar to
rs.getString("TABLE_NAME")
table_cat
table_schem
table_name
table_type
remarks
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: the6campbells@gmail.com
Subject: Re: getTables not returning 10 columns etc
In-Reply-To: <ea56f9bc-e7a2-4b40-8eeb-8cd0b689599c@y6g2000prc.googlegroups.com>
References: <c5c35d9f-3a26-4ac4-bb57-b02f390196ab@v24g2000prn.googlegroups.com> <CADK3HHJfjz398zbbL2zZKRtiz1A6boez=U5mHXPDG8EhCMi==g@mail.gmail.com> <ea56f9bc-e7a2-4b40-8eeb-8cd0b689599c@y6g2000prc.googlegroups.com>
* 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