mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Drop opcintype from index AM strategy translation API
The type argument wasn't actually really necessary. It was a remnant of converting the API of the gist strategy translation from using opclass to using opfamily+opcintype (commitsc09e5a6a01
,622f678c10
). For looking up the gist translation function, we used the convention "amproclefttype = amprocrighttype = opclass's opcintype" (see pg_amproc.h). But each operator family should only have one translation function, and getting the right type for the lookup is sometimes cumbersome and fragile, so this is all unnecessarily complicated. To simplify this, change the gist stategy support procedure to take "any", "any" as argument. (This is arbitrary but seems intuitive. The alternative of using InvalidOid as argument(s) upsets various DDL commands, so it's not practical.) Then we don't need opcintype for the lookup, and we can remove it from all the API layers introduced by commitc09e5a6a01
. This also adds some more documentation about the correct signature of the gist support function and adds more checks in gistvalidate(). This was previously underspecified. (It relied implicitly on convention mentioned above.) Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
This commit is contained in:
@ -9,79 +9,79 @@ AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE STRICT;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_oid_ops USING gist ADD
|
||||
FUNCTION 12 (oid, oid) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_int2_ops USING gist ADD
|
||||
FUNCTION 12 (int2, int2) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_int4_ops USING gist ADD
|
||||
FUNCTION 12 (int4, int4) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_int8_ops USING gist ADD
|
||||
FUNCTION 12 (int8, int8) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_float4_ops USING gist ADD
|
||||
FUNCTION 12 (float4, float4) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_float8_ops USING gist ADD
|
||||
FUNCTION 12 (float8, float8) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_timestamp_ops USING gist ADD
|
||||
FUNCTION 12 (timestamp, timestamp) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_timestamptz_ops USING gist ADD
|
||||
FUNCTION 12 (timestamptz, timestamptz) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_time_ops USING gist ADD
|
||||
FUNCTION 12 (time, time) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_date_ops USING gist ADD
|
||||
FUNCTION 12 (date, date) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_interval_ops USING gist ADD
|
||||
FUNCTION 12 (interval, interval) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_cash_ops USING gist ADD
|
||||
FUNCTION 12 (money, money) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_macaddr_ops USING gist ADD
|
||||
FUNCTION 12 (macaddr, macaddr) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_text_ops USING gist ADD
|
||||
FUNCTION 12 (text, text) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_bpchar_ops USING gist ADD
|
||||
FUNCTION 12 (bpchar, bpchar) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_bytea_ops USING gist ADD
|
||||
FUNCTION 12 (bytea, bytea) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_numeric_ops USING gist ADD
|
||||
FUNCTION 12 (numeric, numeric) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_bit_ops USING gist ADD
|
||||
FUNCTION 12 (bit, bit) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD
|
||||
FUNCTION 12 (varbit, varbit) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_inet_ops USING gist ADD
|
||||
FUNCTION 12 (inet, inet) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_cidr_ops USING gist ADD
|
||||
FUNCTION 12 (cidr, cidr) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_timetz_ops USING gist ADD
|
||||
FUNCTION 12 (timetz, timetz) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_uuid_ops USING gist ADD
|
||||
FUNCTION 12 (uuid, uuid) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_macaddr8_ops USING gist ADD
|
||||
FUNCTION 12 (macaddr8, macaddr8) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_enum_ops USING gist ADD
|
||||
FUNCTION 12 (anyenum, anyenum) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
||||
ALTER OPERATOR FAMILY gist_bool_ops USING gist ADD
|
||||
FUNCTION 12 (bool, bool) gist_stratnum_btree (int) ;
|
||||
FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
|
||||
|
Reference in New Issue
Block a user