Re: BUG and FIX: getTables - SYSTEM TABLE

Lists: pgsql-jdbc
From: "Mitchell J(dot) Friedman" <mitchell_j_friedman(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: BUG and FIX: getTables - SYSTEM TABLE
Date: 2001-11-03 03:35:02
Message-ID: 20011103033502.31887.qmail@web10405.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Mitchell J(dot) Friedman" <mitchell_j_friedman(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: BUG and FIX: getTables - SYSTEM TABLE
Date: 2001-11-07 02:41:28
Message-ID: 200111070241.fA72fSh17406@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


This looks very good. We are in beta now so we will keep it for the 7.3
release.

---------------------------------------------------------------------------

> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Mitchell J(dot) Friedman" <mitchell_j_friedman(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: BUG and FIX: getTables - SYSTEM TABLE
Date: 2002-02-22 19:52:00
Message-ID: 200202221952.g1MJq0t12316@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours. JDBC maintainers will
review.

---------------------------------------------------------------------------

Mitchell J. Friedman wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026