Hi,
Where are the PostgreSQL data types mapped to Java classes? I have found the following from an old mailing list message:
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 1130 macaddr_type Macaddr Type java.lang.Object macaddr 2147483647
...
31 bit2_type Bit2 Type java.lang.Boolean bit 2
32 bitvarying5_type Bitvarying5 Type java.lang.Object varbit 5
Where is the most recent list?
Thank you!
Dave
P.S.
If these are not already in the information_schema (or similar), I think they would make for a worthwhile addition.
Individual adaptions should not be stored external to PostgreSQL. It would be trivial to set up a relation that:
- Maintains a current list of PostgreSQL data types.
- Maintains a list of adapters (perhaps with effective dating).
- Maps adapters to Java types.
This would centralize the knowledge and facilitate dynamic implementations that, for whatever reason, need to know the correct data type mapping in an adapter-agnostic fashion. (Ideally adapters would map the PostgreSQL data types to Java classes the same way; centralizing the list would reveal to everyone the differences in the adapters without having to scour the web.)
This doesn't have to be packaged with PostgreSQL distributions: it could be offered as a separate script that people can run to update the information schema.