sql type reported for enum

From: rcohen(at)e1b(dot)org
To: pgsql-jdbc(at)postgresql(dot)org
Subject: sql type reported for enum
Date: 2015-08-18 21:21:59
Message-ID: OF37F46C75.EF149EDF-ON85257EA5.0073D73F-85257EA5.00755ED5@e1b.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I have some metadata utilities that query jdbc column metadata,
and I'm fairly certain that my enum colums, which used to be reported at
Type.OTHER, are now being reported as Type.VARCHAR.

That is,
rs.getInt("DATA_TYPE")
returns Type.OTHER

The type names, however, seem to be correct. Thus,
rs.getString("TYPE_NAME")
returns the actual enum name.

Not only does my code now behave differently, but I also
see that 3rd party libraries (DBUnit) are also now missing
enum columns.

Thus, DBUnit's PostgresqlDataTypeFactory code for returning enums never
gets hits because the sqlType is never Types.OTHER:

if (sqlType == Types.OTHER)
if ("uuid".equals(sqlTypeName))
return new UuidType();
else if ("interval".equals(sqlTypeName))
return new IntervalType();
else if ("inet".equals(sqlTypeName))
return new InetType();
else
{
// Finally check whether the user defined a custom
datatype
if(isEnumType(sqlTypeName))
{
if(logger.isDebugEnabled())
return new GenericEnumType(sqlTypeName);
}
}

So did something change recently in the drivers? I've recently upgraded
my database from
9.1 to 9.4, along with my jdbc drivers.

Thanks,
Ross

Confidentiality Notice:
This electronic message and any attachments may contain confidential or
privileged information, and is intended only for the individual or entity
identified above as the addressee. If you are not the addressee (or the
employee or agent responsible to deliver it to the addressee), or if this
message has been addressed to you in error, you are hereby notified that
you may not copy, forward, disclose or use any part of this message or any
attachments. Please notify the sender immediately by return e-mail or
telephone and delete this message from your system.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2015-08-19 01:56:55 Re: sql type reported for enum
Previous Message Vitalii Tymchyshyn 2015-08-18 21:04:39 Re: language of error text messages