BUG and FIX: getTables - SYSTEM TABLE - Mailing list pgsql-jdbc

From Mitchell J. Friedman
Subject BUG and FIX: getTables - SYSTEM TABLE
Date
Msg-id 20011103033502.31887.qmail@web10405.mail.yahoo.com
Whole thread Raw
Responses Re: BUG and FIX: getTables - SYSTEM TABLE  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: BUG and FIX: getTables - SYSTEM TABLE  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-jdbc
In getTables in DatabaseMetaData.java it looks like
"TABLE" is returned as the TABLE_TYPE even if the
table is a SYSTEM TABLE.  It looks like the
getTableTypes code is working correctly - if SYSTEM
TABLE is not requested then none are returned.

The problem appears to be in
   case (byte) 'r':
       relKind = "TABLE";
       break;
which kind of forgets that sometimes an 'r' means a
TABLE and other times a SYSTEM TABLE depending on
TABLE_NAME.

the fix would be something like
   case (byte) 'r':
      if (relname.r.getBytes(1).startsWith("pg_"))
         relKind = "SYSTEM TABLE"
      else
         relKind = "TABLE";
      break;

For what its worth I am new to this list - I tried
searching the archive for this bug and was not able to
read the archive.  Hopefully this bug and fix have
already been posted - but if not...

mjf

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

pgsql-jdbc by date:

Previous
From: Jason Davies
Date:
Subject: Re: DatabaseMetaData.getImported/ExportedKeys() patch
Next
From: Jason Davies
Date:
Subject: Re: [jason@netspade.com: DatabaseMetaData.java.diff]