Re: ResultSetMetaData.isNullable(i) and outer joined columns

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Thor Michael Støre <thormichael(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData.isNullable(i) and outer joined columns
Date: 2012-10-12 01:21:03
Message-ID: 5077707F.6090502@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 10/12/2012 01:25 AM, Thor Michael Støre wrote:
> Hello,
>
> I've just noticed that ResultSetMetaData.isNullable(/i/) in the
> PostgreSQL JDBC driver doesn't reflect whether fields of result set
> column /i/ may be null, but the nullability of the table column it's
> selected from. These may differ for result set columns that originate
> from a outer joined table, in which case fields may of course be null
> even if the source table column is not nullable, but in such cases
> isNullable still indicates the column is not nullable. Surely this
> isn't right?
>
> http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSetMetaData.html#isNullable(int)
> <http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSetMetaData.html#isNullable%28int%29>
>
> Although the spec doesn't explicitly distinguish between result set
> and source table only the former seems sensible to me -- what I expect
> the isNullable return value to reflect is whether an invocation of the
> ResultSet.getXXX(/i/) methods always returns an object (or sensible
> primitive), if they may return null or if that's unknown.

It'll be interesting to see how other major vendors' drivers handle this.

Thanks for the test case; I'll try to find some other DBs to run it on.

--
Craig Ringer

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2012-10-12 06:33:39 Re: bug report: slow getColumnTypeName
Previous Message Craig Ringer 2012-10-12 01:17:40 Re: bug report: slow getColumnTypeName