pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: PostgreSQL pgjdbc Datatypes Info
Date: Wed, 04 Nov 2015 11:02:54 -0700
Message-ID: <563A484E.6000307@ttc-cmc.net> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hello,

    I follow the PostgreSQL data types information that can be
generated with the pgjdbc for one of my projects. For anyone
interested this is the mapping for the latest for a table of
each of the basic types.

danap

Created by: PostgreSQL 9.4.1, JDBC 9.4.0-1205

tableMetaData.getColumnLabel(i);
tableMetaData.getColumnClassName(i);
tableMetaData.getColumnType(i);
tableMetaData.getColumnTypeName(i);
tableMetaData.getScale(i);
tableMetaData.getPrecision(i);
tableMetaData.getColumnDisplaySize(i);

index	Name		Class			Type	Type Name	Scale	Precision	Size
1	data_type_id	java.lang.Integer	4	serial		0	10		11
2	smallint_type	java.lang.Integer	5	int2		0	5		6
3	int_type	java.lang.Integer	4	int4		0	10		11
4	bigint_type	java.lang.Long		-5	int8		0	19		20
5	decimal_type	java.math.BigDecimal	2	numeric		2	16		18
6	numeric_type	java.math.BigDecimal	2	numeric		2	10		12
7	real_type	java.lang.Float		7	float4		8	8		15
8	doubleprecision java.lang.Double	8	float8		17	17		25
9	serial_type	java.lang.Integer	4	serial		0	10		11
10	bigserial_type	java.lang.Long		-5	bigserial	0	19		20
11	varchar_type	java.lang.String	12	varchar		0	30		30
12	char_type	java.lang.String	1	bpchar		0	30		30
13	text_type	java.lang.String	12	text		0	2147483647	2147483647
14	bytea_type	[B			-2	bytea		0	2147483647	2147483647
15	date_type	java.sql.Date		91	date		0	13		13
16	time_type	java.sql.Time		92	time		6	15		15
17	timetz_type	java.sql.Time		92	timetz		6	21		21
18	timestamp_type	java.sql.Timestamp	93	timestamp	6	29		29
19	timestamptz     java.sql.Timestamp	93	timestamptz	6	35		35
20	interval_type	util.PGInterval		1111	interval	6	49		49
21	boolean_type	java.lang.Boolean	-7	bool		0	1		1
22	point_type	geometric.PGpoint	1111	point		0	2147483647	2147483647
23	linesegment     geometric.PGlseg	1111	lseg		0	2147483647	2147483647
24	box_type	geometric.PGbox		1111	box		0	2147483647	2147483647
25	path_type	geometric.PGpath	1111	path		0	2147483647	2147483647
26	polygon_type	geometric.PGpolygon	1111	polygon		0	2147483647	2147483647
27	circle_type	geometric.PGcircle	1111	circle		0	2147483647	2147483647
28	cidr_type	java.lang.Object	1111	cidr		0	2147483647	2147483647
29	inet_type	java.lang.Object	1111	inet		0	2147483647	2147483647
30	macaddr_type	java.lang.Object	1111	macaddr		0	2147483647	2147483647
31	bit2_type	java.lang.Boolean	-7	bit		0	2		2
32	bitvarying5     java.lang.Object	1111	varbit		0	5		5







-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



Message-ID: <563A484E.6000307@ttc-cmc.net>
Permalink:  ../563A484E.6000307@ttc-cmc.net/
Also on:    postgresql.org/message-id/563A484E.6000307@ttc-cmc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: danap@ttc-cmc.net
  Subject: Re: PostgreSQL pgjdbc Datatypes Info
  In-Reply-To: <563A484E.6000307@ttc-cmc.net>
  References: <563A484E.6000307@ttc-cmc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox