Start background writer during archive recovery. Background writer now performs
[PostgreSQL.git] / contrib / tablefunc / tablefunc.sql.in
blob0b49649c312895ed99c509333b8ad1023e1e2674
1 /* $PostgreSQL$ */
3 -- Adjust this setting to control where the objects get created.
4 SET search_path = public;
6 CREATE OR REPLACE FUNCTION normal_rand(int4, float8, float8)
7 RETURNS setof float8
8 AS 'MODULE_PATHNAME','normal_rand'
9 LANGUAGE C VOLATILE STRICT;
11 -- the generic crosstab function:
12 CREATE OR REPLACE FUNCTION crosstab(text)
13 RETURNS setof record
14 AS 'MODULE_PATHNAME','crosstab'
15 LANGUAGE C STABLE STRICT;
17 -- examples of building custom type-specific crosstab functions:
18 CREATE TYPE tablefunc_crosstab_2 AS
20 row_name TEXT,
21 category_1 TEXT,
22 category_2 TEXT
25 CREATE TYPE tablefunc_crosstab_3 AS
27 row_name TEXT,
28 category_1 TEXT,
29 category_2 TEXT,
30 category_3 TEXT
33 CREATE TYPE tablefunc_crosstab_4 AS
35 row_name TEXT,
36 category_1 TEXT,
37 category_2 TEXT,
38 category_3 TEXT,
39 category_4 TEXT
42 CREATE OR REPLACE FUNCTION crosstab2(text)
43 RETURNS setof tablefunc_crosstab_2
44 AS 'MODULE_PATHNAME','crosstab'
45 LANGUAGE C STABLE STRICT;
47 CREATE OR REPLACE FUNCTION crosstab3(text)
48 RETURNS setof tablefunc_crosstab_3
49 AS 'MODULE_PATHNAME','crosstab'
50 LANGUAGE C STABLE STRICT;
52 CREATE OR REPLACE FUNCTION crosstab4(text)
53 RETURNS setof tablefunc_crosstab_4
54 AS 'MODULE_PATHNAME','crosstab'
55 LANGUAGE C STABLE STRICT;
57 -- obsolete:
58 CREATE OR REPLACE FUNCTION crosstab(text,int)
59 RETURNS setof record
60 AS 'MODULE_PATHNAME','crosstab'
61 LANGUAGE C STABLE STRICT;
63 CREATE OR REPLACE FUNCTION crosstab(text,text)
64 RETURNS setof record
65 AS 'MODULE_PATHNAME','crosstab_hash'
66 LANGUAGE C STABLE STRICT;
68 CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int,text)
69 RETURNS setof record
70 AS 'MODULE_PATHNAME','connectby_text'
71 LANGUAGE C STABLE STRICT;
73 CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int)
74 RETURNS setof record
75 AS 'MODULE_PATHNAME','connectby_text'
76 LANGUAGE C STABLE STRICT;
78 -- These 2 take the name of a field to ORDER BY as 4th arg (for sorting siblings)
80 CREATE OR REPLACE FUNCTION connectby(text,text,text,text,text,int,text)
81 RETURNS setof record
82 AS 'MODULE_PATHNAME','connectby_text_serial'
83 LANGUAGE C STABLE STRICT;
85 CREATE OR REPLACE FUNCTION connectby(text,text,text,text,text,int)
86 RETURNS setof record
87 AS 'MODULE_PATHNAME','connectby_text_serial'
88 LANGUAGE C STABLE STRICT;