mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
bd04184b11
contrib/tablefunc. Specifically it replaces the use of VIEWs (for needed composite type creation) with use of CREATE TYPE. It also performs GRANT EXECUTE ON FUNCTION foo() TO PUBLIC for all of the created functions. There was also a cosmetic change to two regression files. Joe Conway
60 lines
1.8 KiB
MySQL
60 lines
1.8 KiB
MySQL
CREATE OR REPLACE FUNCTION normal_rand(int4, float8, float8, int4)
|
|
RETURNS setof float8
|
|
AS 'MODULE_PATHNAME','normal_rand' LANGUAGE 'c' VOLATILE STRICT;
|
|
|
|
CREATE TYPE tablefunc_crosstab_2 AS
|
|
(
|
|
row_name TEXT,
|
|
category_1 TEXT,
|
|
category_2 TEXT
|
|
);
|
|
|
|
CREATE TYPE tablefunc_crosstab_3 AS
|
|
(
|
|
row_name TEXT,
|
|
category_1 TEXT,
|
|
category_2 TEXT,
|
|
category_3 TEXT
|
|
);
|
|
|
|
CREATE TYPE tablefunc_crosstab_4 AS
|
|
(
|
|
row_name TEXT,
|
|
category_1 TEXT,
|
|
category_2 TEXT,
|
|
category_3 TEXT,
|
|
category_4 TEXT
|
|
);
|
|
|
|
CREATE OR REPLACE FUNCTION crosstab2(text)
|
|
RETURNS setof tablefunc_crosstab_2
|
|
AS 'MODULE_PATHNAME','crosstab' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION crosstab3(text)
|
|
RETURNS setof tablefunc_crosstab_3
|
|
AS 'MODULE_PATHNAME','crosstab' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION crosstab4(text)
|
|
RETURNS setof tablefunc_crosstab_4
|
|
AS 'MODULE_PATHNAME','crosstab' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION crosstab(text,int)
|
|
RETURNS setof record
|
|
AS 'MODULE_PATHNAME','crosstab' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int,text)
|
|
RETURNS setof record
|
|
AS 'MODULE_PATHNAME','connectby_text' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int)
|
|
RETURNS setof record
|
|
AS 'MODULE_PATHNAME','connectby_text' LANGUAGE 'c' STABLE STRICT;
|
|
|
|
GRANT EXECUTE ON FUNCTION normal_rand(int4, float8, float8, int4) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION crosstab2(text) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION crosstab3(text) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION crosstab4(text) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION crosstab(text,int) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION connectby(text,text,text,text,int,text) TO PUBLIC;
|
|
GRANT EXECUTE ON FUNCTION connectby(text,text,text,text,int) TO PUBLIC;
|