ich einen benutzerdefinierten Bereich Typ erstellt haben:Index ein Array von benutzerdefinierten Bereich Typ in PostgreSQL
CREATE OR REPLACE FUNCTION smallint_subtype_diff(x smallint, y smallint) RETURNS float8 AS
'SELECT (x - y)::float8' LANGUAGE sql STRICT IMMUTABLE;
CREATE TYPE smallintrange AS RANGE (
subtype = smallint,
subtype_opclass = int2_ops,
subtype_diff = smallint_subtype_diff -- required by GiST
);
Es funktioniert gut, und ich kann es Index mit GIST.
Ich möchte jedoch jetzt zu indizieren eine Reihe von dieser Art: smallintrange []
Unabhängig davon, ob ich versuche GiST oder GIN, bekomme ich diese:
CREATE INDEX ix_Vendors_OpenTimes ON public.Vendors USING gin (OpenTimes);
ERROR: data type smallintrange[] has no default operator class for access method "gin" HINT: You must specify an operator class for the index or define a default operator class for the data type.
Wie kann ich Soll das funktionieren?
Vielen Dank. Ich bin mir sicher, dass es erweitert werden könnte, aber das ist ein ganz anderes Level. – IamIC