Set Types pcpointset and pcpatchset

A pcpointset is an ordered set of distinct pcpoint values; a pcpatchset is the analogous set type for pcpatch. Both follow MobilityDB's general set semantics (see Chapter 2, Set and Span Types): values are deduplicated on construction, the binary representation is canonical, and all generic set-level operators (=, <>, <, <=, >, >=, @>, <@, &&, +, -, *) and accessors (numValues, memSize, asText, asBinary, asHexWKB, …) are available.

All values in a set must share the same pcid. Mixing schemas in a single set raises an error at construction time.

Constructors

  • Construct a set from an array of values, all of which must share the same pcid

    set(pcpoint[]) → pcpointset

    set(pcpatch[]) → pcpatchset

    SELECT numValues(set(ARRAY[PC_MakePoint(1, ARRAY[10.0, 20.0, 30.0]),
      PC_MakePoint(1, ARRAY[10.0, 20.0, 30.0]),  -- duplicate, deduped
      PC_MakePoint(1, ARRAY[11.0, 21.0, 31.0])]));
    -- 2