Skip to content

Commit 52d555f

Browse files
committed
Merge branch 'nbenjamin-docs-pgjdbcgh-61'
[resolves pgjdbc#61][pgjdbc#79]
2 parents 5a304ff + 6be3bbb commit 52d555f

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

README.md

+113
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,119 @@ connection
121121

122122
Binding also allowed positional index (zero-based) references. The parameter index is derived from the parameter discovery order when parsing the query.
123123

124+
125+
## Data Type Mapping
126+
127+
This reference table shows the type mapping between [PostgreSQL][p] and Java data types:
128+
129+
| PostgreSQL Type | Supported Data Type |
130+
|:------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
131+
| [`bigint`][psql-bigint-ref] | [**`Long`**][java-long-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Integer`][java-integer-ref] |
132+
| [`bit`][psql-bit-ref] | Not yet supported.|
133+
| [`bit varying`][psql-bit-ref] | Not yet supported.|
134+
| [`boolean or bool`][psql-boolean-ref] | [`Boolean`][java-boolean-ref]|
135+
| [`box`][psql-box-ref] | Not yet supported.|
136+
| [`bytea`][psql-bytea-ref] | Not yet supported.|
137+
| [`character`][psql-character-ref] | [`String`][java-string-ref]|
138+
| [`character varying`][psql-character-ref] | [`String`][java-string-ref]|
139+
| [`cidr`][psql-cidr-ref] | Not yet supported.|
140+
| [`circle`][psql-circle-ref] | Not yet supported.|
141+
| [`date`][psql-date-ref] | [`LocalDate`][java-ld-ref]|
142+
| [`double precision`][psql-floating-point-ref] | [**`Double`**][java-double-ref], [`Float`][java-float-ref]|
143+
| [`inet`][psql-inet-ref] | [**`InetAddress`**][java-inet-ref]|
144+
| [`integer`][psql-integer-ref] | [**`Integer`**][java-integer-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Long`][java-long-ref]|
145+
| [`interval`][psql-interval-ref] | Not yet supported.|
146+
| [`json`][psql-json-ref] | Not yet supported.|
147+
| [`line`][psql-line-ref] | Not yet supported.|
148+
| [`lseg`][psql-lseq-ref] | Not yet supported.|
149+
| [`macaddr`][psql-macaddr-ref] | Not yet supported.|
150+
| [`macaddr8`][psql-macaddr8-ref] | Not yet supported.|
151+
| [`money`][psql-money-ref] | Not yet supported.|
152+
| [`numeric`][psql-bignumeric-ref] | [`BigDecimal`][java-bigdecimal-ref]|
153+
| [`path`][psql-path-ref] | Not yet supported.|
154+
| [`pg_lsn`][psql-pg_lsn-ref] | Not yet supported.|
155+
| [`point`][psql-point-ref] | Not yet supported.|
156+
| [`polygon`][psql-polygon-ref] | Not yet supported.|
157+
| [`real`][psql-real-ref] | [**`Float`**][java-float-ref], [`Double`][java-double-ref]|
158+
| [`smallint`][psql-smallint-ref] | [**`Short`**][java-short-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Integer`][java-integer-ref], [`Long`][java-long-ref]|
159+
| [`smallserial`][psql-smallserial-ref] | [**`Integer`**][java-integer-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Long`][java-long-ref]|
160+
| [`serial`][psql-serial-ref] | [**`Long`**][java-long-ref], [`Boolean`][java-boolean-ref], [`Byte`][java-byte-ref], [`Short`][java-short-ref], [`Integer`][java-integer-ref]|
161+
| [`text`][psql-text-ref] | [`String`][java-string-ref]|
162+
| [`time [without time zone]`][psql-time-ref] | [`LocalTime`][java-lt-ref]|
163+
| [`time [with time zone]`][psql-time-ref] | Not yet supported.|
164+
| [`timestamp [without time zone]`][psql-time-ref]|[`LocalDateTime`][java-ldt-ref]|
165+
| [`timestamp [with time zone]`][psql-time-ref] |[`ZonedDateTime`][java-zdt-ref]|
166+
| [`tsquery`][psql-tsquery-ref] | Not yet supported.|
167+
| [`tsvector`][psql-tsvector-ref] | Not yet supported.|
168+
| [`txid_snapshot`][psql-txid_snapshot-ref] | Not yet supported.|
169+
| [`uuid`][psql-uuid-ref] | [**`UUID`**][java-uuid-ref], [`String`][java-string-ref]||
170+
| [`xml`][psql-xml-ref] | Not yet supported. |
171+
172+
Types in **bold** indicate the native (default) Java type.
173+
174+
Support for the following single-dimensional arrays (read and write):
175+
176+
| PostgreSQL Type | Supported Data Type |
177+
|:-----------------------------------------------|:-------------------------------------|
178+
|[`text[]`][psql-text-ref] |[`String[]`][java-string-ref] |
179+
|[`integer[] or int[]`][psql-integer-ref] |[`Integer[]`][java-integer-ref], [`Long[]`][java-long-ref], [`Short[]`][java-short-ref]|
180+
181+
182+
[psql-bigint-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-INT
183+
[psql-bit-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html
184+
[psql-boolean-ref]: https://www.postgresql.org/docs/11/datatype-boolean.html
185+
[psql-box-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#id-1.5.7.16.8
186+
[psql-bytea-ref]: https://www.postgresql.org/docs/11/datatype-binary.html#id-1.5.7.12.9
187+
[psql-character-ref]: https://www.postgresql.org/docs/11/datatype-character.html
188+
[psql-cidr-ref]: https://www.postgresql.org/docs/11/datatype-net-types.html#DATATYPE-CIDR
189+
[psql-circle-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#DATATYPE-CIRCLE
190+
[psql-date-ref]: https://www.postgresql.org/docs/11/datatype-datetime.html
191+
[psql-floating-point-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-FLOAT
192+
[psql-inet-ref]: https://www.postgresql.org/docs/11/datatype-net-types.html#DATATYPE-INET
193+
[psql-integer-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-INT
194+
[psql-interval-ref]: https://www.postgresql.org/docs/11/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
195+
[psql-json-ref]: https://www.postgresql.org/docs/11/datatype-json.html
196+
[psql-line-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#DATATYPE-LINE
197+
[psql-lseq-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#DATATYPE-LINE
198+
[psql-bignumeric-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
199+
[psql-macaddr-ref]: https://www.postgresql.org/docs/11/datatype-net-types.html#DATATYPE-MACADDR
200+
[psql-macaddr8-ref]: https://www.postgresql.org/docs/11/datatype-net-types.html#DATATYPE-MACADDR8
201+
[psql-money-ref]: https://www.postgresql.org/docs/11/datatype.html
202+
[psql-path-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#id-1.5.7.16.9
203+
[psql-pg_lsn-ref]: https://www.postgresql.org/docs/11/datatype-pg-lsn.html
204+
[psql-point-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#id-1.5.7.16.5
205+
[psql-polygon-ref]: https://www.postgresql.org/docs/11/datatype-geometric.html#DATATYPE-POLYGON
206+
[psql-real-ref]: https://www.postgresql.org/docs/11/datatype.html
207+
[psql-smallint-ref]: https://www.postgresql.org/docs/11/datatype.html
208+
[psql-smallserial-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-SERIAL
209+
[psql-serial-ref]: https://www.postgresql.org/docs/11/datatype-numeric.html#DATATYPE-SERIAL
210+
[psql-text-ref]: https://www.postgresql.org/docs/11/datatype.html
211+
[psql-time-ref]: https://www.postgresql.org/docs/11/datatype-datetime.html
212+
[psql-tsquery-ref]: https://www.postgresql.org/docs/11/datatype-textsearch.html#DATATYPE-TSQUERY
213+
[psql-tsvector-ref]: https://www.postgresql.org/docs/11/datatype-textsearch.html#DATATYPE-TSVECTOR
214+
[psql-txid_snapshot-ref]: https://www.postgresql.org/docs/11/datatype.html
215+
[psql-uuid-ref]: https://www.postgresql.org/docs/11/datatype-uuid.html
216+
[psql-xml-ref]: https://www.postgresql.org/docs/11/datatype-xml.html
217+
218+
219+
[java-bigdecimal-ref]: https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html
220+
[java-boolean-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html
221+
[java-byte-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Byte.html
222+
[java-double-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html
223+
[java-float-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html
224+
[java-inet-ref]: https://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html
225+
[java-instant-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html
226+
[java-integer-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html
227+
[java-long-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html
228+
[java-ldt-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html
229+
[java-ld-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html
230+
[java-lt-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html
231+
[java-odt-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html
232+
[java-short-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/Short.html
233+
[java-string-ref]: https://docs.oracle.com/javase/8/docs/api/java/lang/String.html
234+
[java-uuid-ref]: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html
235+
[java-zdt-ref]: https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html
236+
124237
## License
125238
This project is released under version 2.0 of the [Apache License][l].
126239

0 commit comments

Comments
 (0)