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

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: Thor Michael Støre <thormichael(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData.isNullable(i) and outer joined columns
Date: 2012-10-12 08:51:17
Message-ID: CADK3HH+4w=F7p82zpFDwGb14w3zJ6Z+HH==7a6Xx1TyeK2SJQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I am fairly sure that there is no way to tell from the result set if
the column isNullable or not.

Dave Cramer

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

On Thu, Oct 11, 2012 at 9:21 PM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:
> 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)
>
> 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

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2012-10-12 10:06:37 Re: bug report: slow getColumnTypeName
Previous Message Dave Cramer 2012-10-12 08:50:34 Re: bug report: slow getColumnTypeName