File: icu_ext--1.2--1.3.sql

package info (click to toggle)
icu-ext 1.10.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 360 kB
  • sloc: ansic: 2,701; sql: 763; makefile: 22; sh: 2
file content (43 lines) | stat: -rw-r--r-- 1,288 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- complain if script is sourced in psql, rather than via CREATE/ALTER EXTENSION
\echo Use "ALTER EXTENSION icu_ext UPDATE TO '1.3'" to load this file. \quit

CREATE OR REPLACE FUNCTION icu_sort_key(
 str text,
 collator text
) RETURNS bytea
AS 'MODULE_PATHNAME', 'icu_sort_key_coll'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE COST 10;

COMMENT ON FUNCTION icu_sort_key(text,text)
 IS 'Compute the binary sort key for the string given the collation';

CREATE OR REPLACE FUNCTION icu_sort_key(
 str text
) RETURNS bytea
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE COST 10;

COMMENT ON FUNCTION icu_sort_key(text)
 IS 'Compute the binary sort key with the collate of the string';


CREATE OR REPLACE FUNCTION icu_compare(
 str1 text,
 str2 text
) RETURNS int
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION icu_compare(text,text)
 IS 'Compare two strings with their ICU collation and return a signed int like strcoll';

CREATE OR REPLACE FUNCTION icu_compare(
 str1 text,
 str2 text,
 collator text
) RETURNS int
AS 'MODULE_PATHNAME', 'icu_compare_coll'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION icu_compare(text,text,text)
 IS 'Compare two strings with the given collation and return a signed int like strcoll';