File: pgs_hash.sql.in

package info (click to toggle)
pgsphere 1.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,220 kB
  • sloc: ansic: 13,926; sql: 6,895; cpp: 853; makefile: 278; perl: 168; yacc: 145; python: 106; lex: 55; xml: 51; sh: 1
file content (19 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CREATE FUNCTION spoint_hash32 (spoint)
   RETURNS int
   IMMUTABLE STRICT
   PARALLEL SAFE
   LANGUAGE C
   AS 'MODULE_PATHNAME', 'spherepoint_hash32';

UPDATE pg_operator
   SET oprcanhash = true
   WHERE oprname = '=' AND
     oprleft = 'spoint'::regtype AND oprright = 'spoint'::regtype;

/* PG17: ALTER OPERATOR = (spoint, spoint) SET (HASHES); */

CREATE OPERATOR CLASS spoint_hash_ops
   DEFAULT FOR TYPE spoint USING hash
   AS
      OPERATOR 1 = (spoint, spoint),
      FUNCTION 1 spoint_hash32(spoint);