Re: [GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver(fwd)

2000-10-17 Thread Peter Mount

On Mon, 16 Oct 2000, Bruce Momjian wrote:

 Peter, where are we on this?

Did it some time ago. I've just retrieved the email from my laptop
and checked it against cvs, and it's in there.

Peter

 [ Charset ISO-8859-1 unsupported, converting... ]
  Ok, I've added it to the list of things to check, and commit if not already
  done etc...
  
  Peter
  
  --
  Peter T Mount  [EMAIL PROTECTED], [EMAIL PROTECTED]
  Homepage: http://www.retep.org.uk Contact details: http://petermount.com
  PostgreSQL JDBC: http://www.retep.org.uk/postgres/
  Java PDF Generator: http://www.retep.org.uk/pdf/
  - Original Message -
  From: "Travis Bauer" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, September 04, 2000 4:46 PM
  Subject: [GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver
  (fwd)
  
  
   I sent this to PATCHES last week, but it did not show up on the list.
  
   
   Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
   
  
   -- Forwarded message --
   Date: Thu, 31 Aug 2000 12:26:59 -0500 (EST)
   From: Travis Bauer [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Subject: Change to DatabaseMetaData.java for the jdbc2 driver
  
   This is a patch which lets the DatabaseMetaData return the object type
   when getTables() is called.  It does not really fix any bug, but it
   fills in some functionality that should be there anyway.  The diff
   included here is off of the CVS as of just now :)
  
   
   Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
   
  
  
  
 
 
 -- 
   Bruce Momjian|  http://candle.pha.pa.us
   [EMAIL PROTECTED]   |  (610) 853-3000
   +  If your life is a hard drive, |  830 Blythe Avenue
   +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026
 

-- 
Peter T Mount [EMAIL PROTECTED] http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/





Re: [GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver (fwd)

2000-10-16 Thread Bruce Momjian

Peter, where are we on this?


[ Charset ISO-8859-1 unsupported, converting... ]
 Ok, I've added it to the list of things to check, and commit if not already
 done etc...
 
 Peter
 
 --
 Peter T Mount  [EMAIL PROTECTED], [EMAIL PROTECTED]
 Homepage: http://www.retep.org.uk Contact details: http://petermount.com
 PostgreSQL JDBC: http://www.retep.org.uk/postgres/
 Java PDF Generator: http://www.retep.org.uk/pdf/
 - Original Message -
 From: "Travis Bauer" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, September 04, 2000 4:46 PM
 Subject: [GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver
 (fwd)
 
 
  I sent this to PATCHES last week, but it did not show up on the list.
 
  
  Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
  
 
  -- Forwarded message --
  Date: Thu, 31 Aug 2000 12:26:59 -0500 (EST)
  From: Travis Bauer [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Change to DatabaseMetaData.java for the jdbc2 driver
 
  This is a patch which lets the DatabaseMetaData return the object type
  when getTables() is called.  It does not really fix any bug, but it
  fills in some functionality that should be there anyway.  The diff
  included here is off of the CVS as of just now :)
 
  
  Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
  
 
 
 


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



[GENERAL] Change to DatabaseMetaData.java for the jdbc2 driver (fwd)

2000-09-04 Thread Travis Bauer

I sent this to PATCHES last week, but it did not show up on the list.


Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer


-- Forwarded message --
Date: Thu, 31 Aug 2000 12:26:59 -0500 (EST)
From: Travis Bauer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Change to DatabaseMetaData.java for the jdbc2 driver

This is a patch which lets the DatabaseMetaData return the object type
when getTables() is called.  It does not really fix any bug, but it
fills in some functionality that should be there anyway.  The diff
included here is off of the CVS as of just now :)


Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer



Index: DatabaseMetaData.java
===
RCS file: 
/home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java,v

retrieving revision 1.2
diff -u -r1.2 DatabaseMetaData.java
--- DatabaseMetaData.java   2000/07/20 15:30:05 1.2
+++ DatabaseMetaData.java   2000/08/31 17:24:03
@@ -1651,7 +1651,7 @@
 f[4] = new Field(connection, new String("REMARKS"), iVarcharOid, 32);
 
 // Now form the query
-StringBuffer sql = new StringBuffer("select relname,oid from pg_class where (");
+StringBuffer sql = new StringBuffer("select relname,oid,relkind from pg_class 
+where (");
 boolean notFirst=false;
 for(int i=0;itypes.length;i++) {
   if(notFirst)
@@ -1687,10 +1687,25 @@
  remarks = defaultRemarks;
dr.close();

+   String relKind;
+   switch (r.getBytes(3)[0]) {
+   case 'r':
+   relKind = "TABLE";
+   break;
+   case 'i':
+   relKind = "INDEX";
+   break;
+   case 'S':
+   relKind = "SEQUENCE";
+   break;
+   default:
+   relKind = null;
+   }
+
tuple[0] = null;// Catalog name
tuple[1] = null;// Schema name
-   tuple[2] = r.getBytes(1);   // Table name
-   tuple[3] = null;// Table type
+   tuple[2] = r.getBytes(1);   // Table name   
+   tuple[3] = relKind.getBytes();  // Table type
tuple[4] = remarks; // Remarks
v.addElement(tuple);
   }