@@ -1734,7 +1734,11 @@ PGAPI_Columns(
17341734 * a statement is actually executed, so we'll have to do this
17351735 * ourselves.
17361736 */
1737+ #if (ODBCVER >=0x0300 )
1738+ result_cols = 18 ;
1739+ #else
17371740result_cols = 14 ;
1741+ #endif /* ODBCVER */
17381742extend_bindings (stmt ,result_cols );
17391743
17401744/* set the field names */
@@ -1803,7 +1807,12 @@ PGAPI_Columns(
18031807set_tuplefield_string (& row -> tuple [11 ],"" );
18041808
18051809#if (ODBCVER >=0x0300 )
1810+ set_tuplefield_null (& row -> tuple [12 ]);
18061811set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1812+ set_tuplefield_null (& row -> tuple [14 ]);
1813+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1814+ set_tuplefield_int4 (& row -> tuple [16 ],0 );
1815+ set_tuplefield_string (& row -> tuple [17 ],"No" );
18071816#else
18081817set_tuplefield_int4 (& row -> tuple [12 ],pgtype_display_size (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
18091818set_tuplefield_int4 (& row -> tuple [13 ],the_type );
@@ -1918,9 +1927,12 @@ PGAPI_Columns(
19181927break ;
19191928default :
19201929set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1930+ set_tuplefield_null (& row -> tuple [14 ]);
19211931break ;
19221932}
1933+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,field_type ,PG_STATIC ,PG_STATIC ));
19231934set_tuplefield_int4 (& row -> tuple [16 ],field_number );
1935+ set_tuplefield_null (& row -> tuple [17 ]);
19241936#else
19251937set_tuplefield_int4 (& row -> tuple [13 ],field_type );
19261938#endif /* ODBCVER */
@@ -1956,16 +1968,26 @@ PGAPI_Columns(
19561968set_tuplefield_string (& row -> tuple [1 ],"" );
19571969set_tuplefield_string (& row -> tuple [2 ],table_name );
19581970set_tuplefield_string (& row -> tuple [3 ],"xmin" );
1959- set_tuplefield_int2 (& row -> tuple [4 ],pgtype_to_sqltype (stmt ,the_type ));
1971+ sqltype = pgtype_to_sqltype (stmt ,the_type );
1972+ set_tuplefield_int2 (& row -> tuple [4 ],sqltype );
19601973set_tuplefield_string (& row -> tuple [5 ],pgtype_to_name (stmt ,the_type ));
19611974set_tuplefield_int4 (& row -> tuple [6 ],pgtype_precision (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
19621975set_tuplefield_int4 (& row -> tuple [7 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
19631976set_nullfield_int2 (& row -> tuple [8 ],pgtype_scale (stmt ,the_type ,PG_STATIC ));
19641977set_nullfield_int2 (& row -> tuple [9 ],pgtype_radix (stmt ,the_type ));
19651978set_tuplefield_int2 (& row -> tuple [10 ],SQL_NO_NULLS );
19661979set_tuplefield_string (& row -> tuple [11 ],"" );
1980+ #if (ODBCVER >=0x0300 )
1981+ set_tuplefield_null (& row -> tuple [12 ]);
1982+ set_tuplefield_int2 (& row -> tuple [13 ],sqltype );
1983+ set_tuplefield_null (& row -> tuple [14 ]);
1984+ set_tuplefield_int4 (& row -> tuple [15 ],pgtype_length (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
1985+ set_tuplefield_int4 (& row -> tuple [16 ],0 );
1986+ set_tuplefield_string (& row -> tuple [17 ],"No" );
1987+ #else
19671988set_tuplefield_int4 (& row -> tuple [12 ],pgtype_display_size (stmt ,the_type ,PG_STATIC ,PG_STATIC ));
19681989set_tuplefield_int4 (& row -> tuple [13 ],the_type );
1990+ #endif /* ODBCVER */
19691991
19701992QR_add_tuple (res ,row );
19711993}