Index: src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java =================================================================== --- src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java (revision 3238) +++ src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java (working copy) @@ -148,7 +148,8 @@ "pt.oid as atttypid," + //$NON-NLS-1$ "pt.typlen as attlen, " + //$NON-NLS-1$ "convert(t1.Position, short) as attnum, " + //$NON-NLS-1$ - "t1.Length as atttypmod, " + //$NON-NLS-1$ + "(CASE WHEN (t1.DataType = 'bigdecimal' OR t1.DataType = 'biginteger' OR t1.DataType = 'float' OR t1.DataType='double') THEN (4+(65536*t1.Precision)+t1.Scale) " + //$NON-NLS-1$ + "ELSE (4+t1.Length) END) as atttypmod, " + //$NON-NLS-1$ "CASE WHEN (t1.NullType = 'No Nulls') THEN true ELSE false END as attnotnull, " + //$NON-NLS-1$ "false as attisdropped, " + //$NON-NLS-1$ "false as atthasdef " + //$NON-NLS-1$ Index: src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java =================================================================== --- src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java (revision 3238) +++ src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java (working copy) @@ -462,7 +462,12 @@ } else { try { + // The response is a ParameterDescription message describing the parameters needed by the statement, this.client.sendParameterDescription(query.stmt.getParameterMetaData(), query.paramType); + + // followed by a RowDescription message describing the rows that will be returned when the statement + // is eventually executed (or a NoData message if the statement will not return rows). + this.client.sendResultSetDescription(query.stmt.getMetaData(), query.stmt); } catch (SQLException e) { this.client.errorOccurred(e); } Index: src/main/java/org/teiid/transport/PgBackendProtocol.java =================================================================== --- src/main/java/org/teiid/transport/PgBackendProtocol.java (revision 3238) +++ src/main/java/org/teiid/transport/PgBackendProtocol.java (working copy) @@ -214,7 +214,7 @@ if (paramType != null && paramType[i] != 0) { type = paramType[i]; } else { - type = PG_TYPE_VARCHAR; + type = convertType(meta.getParameterType(i+1)); } writeInt(type); }