A temporal cell value is entered using the standard temporal syntax with the underlying 64-bit cell identifier. The input parser accepts the canonical hexadecimal form each grid publishes — the form the H3 CLI and h3_cell_to_string emit, and the form the CARTO reference implementation reads — with an optional 0x prefix, in either letter case, and at most 16 significant digits. Hexadecimal is idiomatic in all three ecosystems and is what the output function emits, so every example below uses it. The value must also denote something its grid indexes: for H3 a cell, a directed edge or a vertex, so that a well-formed hexadecimal literal such as 12345, which is none of the three, is rejected rather than stored as a value with no location. For reference, the hexadecimal 480fffffffffffff used in the examples is the QUADBIN resolution-0 world cell, equal to the decimal 5192650370358181887.
Input and output of a temporal cell in its text form
tcell(text) → tcell text(tcell) → text
The companion static type cell holds a single (non-temporal) cell identifier and cellset a finite set of them; they share the temporal type's hexadecimal / decimal textual representation, carry the standard equality and ordering operators through a btree and a hash operator class, and expose the validity predicates below. A type modifier constrains a column to one subtype, which is Instant, or Sequence, or SequenceSet.
SELECT th3index '831c02fffffffff@2001-01-01';
-- 831c02fffffffff@2001-01-01
SELECT tquadbin '[48a6227affffffff@2001-01-01, 485623ffffffffff@2001-01-02]';
-- [48a6227affffffff@2001-01-01, 485623ffffffffff@2001-01-02]
SELECT ts2cell '{[47c3c@2001-01-01, 47c4@2001-01-02]}';
-- {[47c3c@2001-01-01, 47c4@2001-01-02]}
Serialize a temporal cell as text, as binary, as hexadecimal well-known binary, or as MF-JSON
asText(tcell) → text asBinary(tcell,endian text='') → bytea asHexWKB(tcell,endian text='') → text asMFJSON(tcell) → text
The hexadecimal well-known binary form lets a temporal cell column round-trip through a text-based COPY. In MF-JSON the cell payload renders as the int64 cell identifier in the values array, the same representation tbigint carries.
SELECT asHexWKB(th3index '831c02fffffffff@2001-01-01'); -- 01460021FFFFFFFF2FC031080060885EC91C0000 SELECT asHexWKB(tquadbin '48a6227affffffff@2001-01-01'); -- 01490001FFFFFFFF7A22A6480060885EC91C0000 SELECT asHexWKB(ts2cell '47c3c@2001-01-01'); -- 015700210000000000C0C3470060885EC91C0000
Reconstruct a temporal cell from its binary, hexadecimal, or MF-JSON representation
tcellFromBinary(bytea) → tcell tcellFromHexWKB(text) → tcell tcellFromMFJSON(text) → tcell
SELECT th3indexFromHexWKB(asHexWKB(th3index '831c02fffffffff@2001-01-01')); -- 831c02fffffffff@2001-01-01 SELECT tquadbinFromHexWKB(asHexWKB(tquadbin '48a6227affffffff@2001-01-01')); -- 48a6227affffffff@2001-01-01 SELECT ts2cellFromHexWKB(asHexWKB(ts2cell '47c3c@2001-01-01')); -- 47c3c@2001-01-01