-
Notifications
You must be signed in to change notification settings - Fork 4
/
jsonknife--1.0.sql
52 lines (42 loc) · 1.45 KB
/
jsonknife--1.0.sql
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
44
45
46
47
48
49
50
51
52
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION jsonknife" to load this file. \quit
CREATE OR REPLACE FUNCTION knife_extract(jsonb, jsonb)
RETURNS jsonb[]
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-- CREATE OR REPLACE FUNCTION knife_extract_text_array(jsonb, jsonb)
-- RETURNS text[]
-- AS 'MODULE_PATHNAME'
-- LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_text(jsonb, jsonb)
RETURNS text[]
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_numeric(jsonb, jsonb)
RETURNS numeric[]
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_max_numeric(jsonb, jsonb)
RETURNS numeric
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_min_numeric(jsonb, jsonb)
RETURNS numeric
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_timestamptz(jsonb, jsonb)
RETURNS timestamptz[]
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_max_timestamptz(jsonb, jsonb)
RETURNS timestamptz
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_extract_min_timestamptz(jsonb, jsonb)
RETURNS timestamptz
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION knife_date_bound(text, text)
RETURNS timestamptz
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;