Re: TypeInfoCache - Mailing list pgsql-jdbc
From | dmp |
---|---|
Subject | Re: TypeInfoCache |
Date | |
Msg-id | 476C1F7E.5020004@ttc-cmc.net Whole thread Raw |
In response to | Re: TypeInfoCache (Oliver Jowett <oliver@opencloud.com>) |
Responses |
Re: TypeInfoCache
|
List | pgsql-jdbc |
This is the standard output I obtain from a database about its data types. I use the defined data types from manuals. This is important to the MyJSQLView program because if a database defines a data type I need to assume that a user somewhere will use it so I have to be able to handle it. This seems sensible from the perspective of a generic database GUI access too. I admit two areas I have not addressed yet in the current version of the application are user defined and arrays. Noticed the asterisked rows. These are data types that are specific to PostgreSQL. Granted each database is going to have a few of these. Notice the returned Class & Type. The 'object' class returned are fine for the Network Address types, since the Sun Java JDBC defines methods for objects in the getter/setter methods, but the the Interval and Geometric data types return specific types that are not defined by the Sun Java JDBC, 'PGxxx'. I have learned how to properly handle these types without importing them from the org.postgresql driver, but I would call them deviants. By the way importing such deviants from a database driver in a generic GUI is not particular acceptable. Maybe I'm missing something there; Anyway I would think that standard data types should really relate more to hardware and the the specifics of the nature of program's, in this case database, requirements. Example blob/bytea. This is a obvious specific to a database program and so therefore should be an extension to the standard data types. If points and circles are going to be added is then next perhaps mole? danap ----------------------- PostgreSQL 8.2.5 ColumnName, Modified ColumnName, ColumnClassName, ColumnClassType, ColumnPreferedSize 1 data_type_id Data Type Id java.lang.Integer int4 11 2 smallint_type Smallint Type java.lang.Integer int2 6 3 int_type Int Type java.lang.Integer int4 11 4 bigint_type Bigint Type java.lang.Long int8 20 5 decimal_type Decimal Type java.math.BigDecimal numeric 18 6 numeric_type Numeric Type java.math.BigDecimal numeric 12 7 real_type Real Type java.lang.Float float4 14 8 doubleprecision_type Doubleprecision Type java.lang.Double float8 24 9 serial_type Serial Type java.lang.Integer int4 11 10 bigserial_type Bigserial Type java.lang.Long int8 20 11 varchar_type Varchar Type java.lang.String varchar 30 12 char_type Char Type java.lang.String bpchar 30 13 text_type Text Type java.lang.String text 2147483647 14 bytea_type Bytea Type [B bytea 2147483647 15 date_type Date Type java.sql.Date date 13 16 time_type Time Type java.sql.Time time 15 17 timetz_type Timetz Type java.sql.Time timetz 21 18 timestamp_type Timestamp Type java.sql.Timestamp timestamp 29 19 timestamptz_type Timestamptz Type java.sql.Timestamp timestamptz 35 *20 interval_type Interval Type org.postgresql.util.PGInterval interval 49 21 boolean_type Boolean Type java.lang.Boolean bool 1 *22 point_type Point Type org.postgresql.geometric.PGpoint point 2147483647 *23 linesegment_type Linesegment Type org.postgresql.geometric.PGlseg lseg 2147483647 *24 box_type Box Type org.postgresql.geometric.PGbox box 2147483647 *25 path_type Path Type org.postgresql.geometric.PGpath path 2147483647 *26 polygon_type Polygon Type org.postgresql.geometric.PGpolygon polygon 2147483647 *27 circle_type Circle Type org.postgresql.geometric.PGcircle circle 2147483647 *28 cidr_type Cidr Type java.lang.Object cidr 2147483647 *29 inet_type Inet Type java.lang.Object inet 2147483647 *30 macaddr_type Macaddr Type java.lang.Object macaddr 2147483647 31 bit2_type Bit2 Type java.lang.Boolean bit 2 32 bitvarying2_type Bitvarying2 Type java.lang.Object varbit 5
pgsql-jdbc by date: