You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2b10f5f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/postgresql.md
+22-24Lines changed: 22 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,15 +110,16 @@ accepted and map exactly like their unparameterized spellings.
110
110
111
111
| Accepted SQL spellings | Java type | Notes |
112
112
| --- | --- | --- |
113
-
|`INTEGER`, `INT`, `SERIAL`|`Integer`| A `SERIAL` column is always modeled non-null. |
114
-
|`BIGINT`, `BIGSERIAL`|`Long`| A `BIGSERIAL` column is always modeled non-null. |
115
-
|`SMALLINT`|`Short`||
113
+
|`INTEGER`, `INT`, `INT4`, `SERIAL`, `SERIAL4`|`Integer`| A serial column is always modeled non-null. |
114
+
|`BIGINT`, `INT8`, `BIGSERIAL`, `SERIAL8`|`Long`| A serial column is always modeled non-null. |
115
+
|`SMALLINT`, `INT2`, `SMALLSERIAL`, `SERIAL2`|`Short`| A serial column is always modeled non-null.|
116
116
|`BOOLEAN`, `BOOL`|`Boolean`||
117
-
|`VARCHAR`|`String`||
117
+
|`VARCHAR`, `CHARACTER VARYING`|`String`||
118
+
|`CHAR`, `CHARACTER`|`String`| PostgreSQL blank-pads a stored value to the declared length, so `ab` written into a `CHAR(3)` column reads back as `ab `. |
118
119
|`TEXT`|`String`||
119
120
|`DATE`|`java.time.LocalDate`||
120
-
|`TIMESTAMP`|`java.time.LocalDateTime`||
121
-
|`TIMESTAMP WITH TIME ZONE`|`java.time.OffsetDateTime`| PostgreSQL normalizes the stored value to the session time zone, so a value read back equals the written value by instant rather than by offset. |
121
+
|`TIMESTAMP`, `TIMESTAMP WITHOUT TIME ZONE`|`java.time.LocalDateTime`||
122
+
|`TIMESTAMP WITH TIME ZONE`, `TIMESTAMPTZ`|`java.time.OffsetDateTime`| PostgreSQL normalizes the stored value to the session time zone, so a value read back equals the written value by instant rather than by offset. |
122
123
|`DECIMAL`, `NUMERIC`|`java.math.BigDecimal`||
123
124
|`UUID`|`java.util.UUID`||
124
125
@@ -185,9 +186,10 @@ Nullability itself is parsed from `NOT NULL` only:
185
186
186
187
- a column without `NOT NULL` is modeled nullable, so a column declared bare
187
188
`PRIMARY KEY` is modeled nullable,
188
-
- a `SERIAL` or `BIGSERIAL` column is always modeled non-null, because
189
-
PostgreSQL defines those spellings as an integer type with a sequence default
190
-
and `NOT NULL`,
189
+
- a serial column, declared `SMALLSERIAL`, `SERIAL`, `BIGSERIAL`, `SERIAL2`,
190
+
`SERIAL4`, or `SERIAL8`, is always modeled non-null, because PostgreSQL
191
+
defines those spellings as an integer type with a sequence default and
192
+
`NOT NULL`,
191
193
- nullability never changes a generated Java type. It is carried into the
192
194
analyzed model, but the generated type is resolved from the column type alone.
193
195
@@ -198,14 +200,6 @@ columns of the integration schema snapshot, which cover `SMALLINT`, `VARCHAR`,
198
200
199
201
## Unsupported Types and DDL
200
202
201
-
These spellings are rejected even though PostgreSQL accepts them:
202
-
203
-
-`TIMESTAMPTZ`
204
-
-`SERIAL4`
205
-
-`SERIAL8`
206
-
-`SMALLSERIAL`
207
-
-`TIMESTAMP WITHOUT TIME ZONE`
208
-
209
203
The following type families are not supported at all, because only the
210
204
spellings listed in [Supported Column Types](#supported-column-types) are
211
205
accepted:
@@ -235,7 +229,7 @@ The message names the schema source and the offending type or statement, or the
235
229
syntax error with the line and column it was found at:
0 commit comments