show table tbname; does not show the "timestamp" type description

Bug #1154916 reported by Alvin Peng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stado
Fix Committed
Undecided
Unassigned

Bug Description

I have a table, with the column t of time type.
create table test2(id int, d date, t time);

In psql client, "\d" command shows the type description, while "show table " command shows that the "TYPE_NAME" is an empty string.

xtest=> \d test2
            Table "public.test2"
 Column | Type | Modifiers
--------+------------------------+-----------
 id | integer |
 d | date |
 t | time without time zone |

xtest=> show table test2;
 COLUMN_NAME | SQL_DATA_TYPE | TYPE_NAME | IS_NULLABLE | KEY | DEFAULT
-------------+---------------+-----------+-------------+-----+---------
 id | 4 | INTEGER | YES | NO |
 d | 91 | DATE | YES | NO |
 t | 92 | | YES | NO |
(3 rows)

======
In DataTypes.java:

    public static String getJavaTypeDesc(int sqlType, int length, int precision, int scale, boolean withTimeZone) {
        String typeString = "";
        HashMap<String, String> map = new HashMap<String,String>();
        map.put("length", "" + length);
        map.put("precision", "" + precision);
        map.put("scale", "" + scale);

        switch (sqlType) {
            case Types.TIME:
                return ParseCmdLine.substitute(typeString, map);
            case Types.TIMESTAMP:
                return ParseCmdLine.substitute(typeString, map);
            default:
                return getJavaTypeDesc(sqlType);
        }
    }

Why the types "TIME" and "TIMESTAMP" do not get java type desc?

Related branches

Revision history for this message
Andrei Martsinchyk (andrei-martsinchyk) wrote :

It is unclear, the reference to FB# 7753 is not longer available.
So always call getJavaTypeDesc to get type description.

Changed in stado:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.