Data types
How pgJDBC maps PostgreSQL types to Java types: temporal types
(java.time), binary data, arrays, geometric types, large objects,
and the infinity sentinel.
- Binary data (BYTEA)
Choosing between the
BYTEAcolumn type and the large-object API for binary payloads: 1 GB memory ceiling onBYTEA, separate ACLs and manual deletion on large objects, and which JDBCgetBytes/getBlobmethods target each. - Arrays
Working with PostgreSQL array columns from JDBC:
Connection.createArrayOfand thePGConnectionoverload for primitive arrays, the Java-to-PG type mapping table, and which element types travel as binary inPreparedStatement.setObject. - Date and time
Mapping PostgreSQL temporal types (
DATE,TIME,TIMESTAMP, with and without time zone) to Java 8java.timetypes via JDBC 4.2, the UTC-normalised return ofOffsetDateTime, and whyZonedDateTimeandInstantare unsupported. - Date and timestamp infinity
How the driver represents PostgreSQL
-infinityandinfinitytimestamps:LocalDate.MIN/MAX(and analogous sentinels) forjava.time, andPGStatement.DATE_NEGATIVE_INFINITY/DATE_POSITIVE_INFINITYfor legacyTimestamp. - Geometric types
Reading and writing PostgreSQL geometric types (
point,line,box,path,polygon,circle) through theorg.postgresql.geometricclasses, with an examplePGcircle/PGpointround-trip. - Large objects
Reading and writing PostgreSQL large objects (LO / OID) through the
LargeObjectManagerandLargeObjectextension classes, which give random access to the object’s contents beyond what standardBlob/Cloballow.