Mapping Oracle Data Types to PGX Data Types

When creating the graph using relational tables, the property graph wizard converts the Oracle AI Database 26ai data types to the graph server (PGX) data types.

The following table shows a few supported input types and the corresponding default mapping when transformed into graph properties:

Oracle AI Database 26ai TypeFoot 1 Oracle PGX Type
NUMBER The following implicit type conversion rules apply:
  • NUMBER => LONG (for key columns)
  • NUMBER => DOUBLE (for non-key columns)
  • NUMBER(m) (number having precision m) with m <= 9 => INTEGER
  • NUMBER(m) (number having precision m) with 9 < m <= 18 => LONG
  • NUMBER(m,n) (number having precision m and scale n) => DOUBLE

    Note that this applies if n > 0. Otherwise, it follows the same mapping as NUMBER(x), where x = m-n (that is, subtracting the scale from the precision). The PGX type can then vary, depending on the x value as shown:

    • x <= 9 => INTEGER
    • 9 < x <= 18 => LONG
    • x > 18 => DOUBLE

      For instance, consider a scenario where n = -100 and m = 1. In this case, x = 101 (m-n), which is greater than 18. Extremely large numbers cannot be encoded to fit in INTEGER or LONG and therefore require the DOUBLE data type.

CHAR or NCHAR STRING
VARCHAR, VARCHAR2, or NVARCHAR2 STRING
BINARY_FLOAT FLOAT
BINARY_DOUBLE DOUBLE
FLOAT The following implicit type conversion rules apply:
  • FLOAT(m) with m <= 23 => FLOAT
  • FLOAT(m) with 23 < m => DOUBLE

In the preceding entries, m is the variable for precision.

CLOB STRING
DATE or TIMESTAMP TIMESTAMP
TIMESTAMP WITH LOCAL TIME ZONE TIMESTAMP
TIMESTAMP WITH TIME ZONE TIMESTAMP WITH TIME ZONE

Footnote 1 Data types for PGQL property graphs and SQL property graphs share a one-to-one mapping with Oracle AI Database 26ai data types.