Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
===================================================================
RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v
retrieving revision 1.51.2.5
diff -u -r1.51.2.5 AbstractJdbc2DatabaseMetaData.java
--- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java	10 Aug 2010 19:46:19 -0000	1.51.2.5
+++ org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java	2 Sep 2010 15:03:52 -0000
@@ -2375,6 +2375,25 @@
 
             tuple[4] = connection.encodeString(Integer.toString(sqlType));
             String pgType = connection.getTypeInfo().getPGType(typeOid);
+	    
+	    if (sqlType == Types.STRUCT){
+		    String schemaSql = null;
+		    if (connection.haveMinimumServerVersion("7.3")) {
+			schemaSql = "SELECT pg_namespace.nspname || '.' FROM pg_catalog.pg_type JOIN pg_catalog.pg_namespace ON pg_namespace.oid = pg_type.typnamespace WHERE pg_type.oid = ?";
+		    } else {
+			schemaSql = "SELECT pg_namespace.nspname || '.' FROM pg_type JOIN pg_namespace ON pg_namespace.oid = pg_type.typnamespace WHERE pg_type.oid = ?";
+		    }  
+		    PreparedStatement _getSchemaStatement = connection.prepareStatement(schemaSql);
+		    _getSchemaStatement.setInt(1, typeOid);
+		    if (!((BaseStatement) _getSchemaStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN)) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
+
+		    ResultSet schemaRs = _getSchemaStatement.getResultSet();
+		    if (!schemaRs.next()) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
+		    pgType = schemaRs.getString(1) + pgType;
+		    schemaRs.close();
+	    }
+
+	    
             tuple[5] = connection.encodeString(pgType); // Type name
             tuple[7] = null;      // Buffer length
 