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
// Postgres doesn't make use of a small integer type for integer returns, which presents a bit of a conundrum.
225
-
// GMS defines boolean operations as the smallest integer type, while Postgres has an explicit bool type.
226
-
// We can't always assume that `INT8` means bool, since it could just be a small integer. As a result, we'll
227
-
// always return this as though it's an `INT16`, which also means that we can't support bools right now.
228
-
// OIDs 16 (bool) and 18 (char, ASCII only?) are the only single-byte types as far as I'm aware.
229
-
returnuint32(oid.T_int2), nil
230
-
casequery.Type_INT16:
231
-
// The technically correct OID is 21 (2-byte integer), however it seems like some clients don't actually expect
232
-
// this, so I'm not sure when it's actually used by Postgres. Because of this, we'll just pretend it's an `INT32`.
233
-
returnuint32(oid.T_int2), nil
234
-
casequery.Type_INT24:
235
-
// Postgres doesn't have a 3-byte integer type, so just pretend it's `INT32`.
236
-
returnuint32(oid.T_int4), nil
237
-
casequery.Type_INT32:
238
-
returnuint32(oid.T_int4), nil
239
-
casequery.Type_INT64:
240
-
returnuint32(oid.T_int8), nil
241
-
casequery.Type_UINT8:
242
-
returnuint32(oid.T_int4), nil
243
-
casequery.Type_UINT16:
244
-
returnuint32(oid.T_int4), nil
245
-
casequery.Type_UINT24:
246
-
returnuint32(oid.T_int4), nil
247
-
casequery.Type_UINT32:
248
-
// Since this has an upperbound greater than `INT32`, we'll treat it as `INT64`
249
-
returnuint32(oid.T_oid), nil
250
-
casequery.Type_UINT64:
251
-
// Since this has an upperbound greater than `INT64`, we'll treat it as `NUMERIC`
252
-
returnuint32(oid.T_numeric), nil
253
-
casequery.Type_FLOAT32:
254
-
returnuint32(oid.T_float4), nil
255
-
casequery.Type_FLOAT64:
256
-
returnuint32(oid.T_float8), nil
257
-
casequery.Type_DECIMAL:
258
-
returnuint32(oid.T_numeric), nil
259
-
casequery.Type_CHAR:
260
-
returnuint32(oid.T_char), nil
261
-
casequery.Type_VARCHAR:
262
-
returnuint32(oid.T_varchar), nil
263
-
casequery.Type_TEXT:
264
-
returnuint32(oid.T_text), nil
265
-
casequery.Type_BLOB:
266
-
returnuint32(oid.T_bytea), nil
267
-
casequery.Type_JSON:
268
-
returnuint32(oid.T_json), nil
269
-
casequery.Type_TIMESTAMP, query.Type_DATETIME:
270
-
returnuint32(oid.T_timestamp), nil
271
-
casequery.Type_DATE:
272
-
returnuint32(oid.T_date), nil
273
-
casequery.Type_NULL_TYPE:
274
-
returnuint32(oid.T_text), nil// NULL is treated as TEXT on the wire
275
-
casequery.Type_ENUM:
276
-
returnuint32(oid.T_text), nil// TODO: temporary solution until we support CREATE TYPE
277
-
casequery.Type_EXPRESSION:
278
-
returnuint32(oid.T_text), nil// this most closely matches the behavior in postgres, which treats any unresolved type as a string (unless it has special handling)
0 commit comments