Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-10-06 6bac54b555d27f1a85c1e4f011a6e7bd9111b0d0
src/include/catalog/pg_cast.dat
@@ -589,4 +589,79 @@
{ castsource => 'tstzrange', casttarget => 'tstzmultirange',
  castfunc => 'tstzmultirange(tstzrange)', castcontext => 'e',
  castmethod => 'f' },
# vector casts
{ castsource => 'vector', casttarget => 'vector',
  castfunc => 'vector', castcontext => 'i',
  castmethod => 'f' },
{ castsource => 'vector', casttarget => '_float4',
  castfunc => 'vector_to_float4', castcontext => 'i',
  castmethod => 'f' },
{ castsource => '_int4', casttarget => 'vector',
  castfunc => 'array_to_vector(_int4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float4', casttarget => 'vector',
  castfunc => 'array_to_vector(_float4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float8', casttarget => 'vector',
  castfunc => 'array_to_vector(_float8,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_numeric', casttarget => 'vector',
  castfunc => 'array_to_vector(_numeric,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
# halfvec casts
{ castsource => 'halfvec', casttarget => 'halfvec',
  castfunc => 'halfvec', castcontext => 'i',
  castmethod => 'f' },
{ castsource => 'halfvec', casttarget => 'vector',
  castfunc => 'halfvec_to_vector', castcontext => 'a',
  castmethod => 'f' },
{ castsource => 'vector', casttarget => 'halfvec',
  castfunc => 'vector_to_halfvec', castcontext => 'i',
  castmethod => 'f' },
{ castsource => 'halfvec', casttarget => '_float4',
  castfunc => 'halfvec_to_float4', castcontext => 'i',
  castmethod => 'f' },
{ castsource => '_int4', casttarget => 'halfvec',
  castfunc => 'array_to_halfvec(_int4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float4', casttarget => 'halfvec',
  castfunc => 'array_to_halfvec(_float4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float8', casttarget => 'halfvec',
  castfunc => 'array_to_halfvec(_float8,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_numeric', casttarget => 'halfvec',
  castfunc => 'array_to_halfvec(_numeric,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
# sparsevec casts
{ castsource => 'sparsevec', casttarget => 'sparsevec',
  castfunc => 'sparsevec', castcontext => 'i',
  castmethod => 'f' },
{ castsource => 'sparsevec', casttarget => 'vector',
  castfunc => 'sparsevec_to_vector', castcontext => 'a',
  castmethod => 'f' },
{ castsource => 'vector', casttarget => 'sparsevec',
  castfunc => 'vector_to_sparsevec', castcontext => 'i',
  castmethod => 'f' },
{ castsource => 'sparsevec', casttarget => 'halfvec',
  castfunc => 'sparsevec_to_halfvec', castcontext => 'a',
  castmethod => 'f' },
{ castsource => 'halfvec', casttarget => 'sparsevec',
  castfunc => 'halfvec_to_sparsevec', castcontext => 'i',
  castmethod => 'f' },
{ castsource => '_int4', casttarget => 'sparsevec',
  castfunc => 'array_to_sparsevec(_int4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float4', casttarget => 'sparsevec',
  castfunc => 'array_to_sparsevec(_float4,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_float8', casttarget => 'sparsevec',
  castfunc => 'array_to_sparsevec(_float8,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
{ castsource => '_numeric', casttarget => 'sparsevec',
  castfunc => 'array_to_sparsevec(_numeric,int4,bool)', castcontext => 'a',
  castmethod => 'f' },
]