diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-10-18 18:41:22 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-10-18 18:41:22 +0000 |
| commit | aa4c702eac936964649f905741b4a99f4b489200 (patch) | |
| tree | 517d3c28aa3d28eb95b19c8676c940b5cefe2031 /contrib/intagg | |
| parent | fb9bc342fffc157d6ca4b635aeeaccb3c1370b91 (diff) | |
| download | postgresql-aa4c702eac936964649f905741b4a99f4b489200.tar.gz | |
Update /contrib for "autocommit TO 'on'".
Create objects in public schema.
Make spacing/capitalization consistent.
Remove transaction block use for object creation.
Remove unneeded function GRANTs.
Diffstat (limited to 'contrib/intagg')
| -rw-r--r-- | contrib/intagg/int_aggregate.sql.in | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/contrib/intagg/int_aggregate.sql.in b/contrib/intagg/int_aggregate.sql.in index fcba720f32..1d5f83e682 100644 --- a/contrib/intagg/int_aggregate.sql.in +++ b/contrib/intagg/int_aggregate.sql.in @@ -1,28 +1,25 @@ --- Drop functions -drop aggregate int_array_aggregate(int4); -drop function int_agg_state (int4, int4); -drop function int_agg_final_array (int4); -drop function int_array_enum (int4[]); +-- Adjust this setting to control where the objects get created. +SET search_path = public; +SET autocommit TO 'on'; -- Internal function for the aggregate -- Is called for each item in an aggregation -create function int_agg_state (int4, int4) - returns int4 - as 'MODULE_PATHNAME','int_agg_state' - language 'c'; +CREATE OR REPLACE FUNCTION int_agg_state (int4, int4) +RETURNS int4 +AS 'MODULE_PATHNAME','int_agg_state' +LANGUAGE 'C'; -- Internal function for the aggregate -- Is called at the end of the aggregation, and returns an array. -create function int_agg_final_array (int4) - returns int4[] - as 'MODULE_PATHNAME','int_agg_final_array' - language 'c'; +CREATE OR REPLACE FUNCTION int_agg_final_array (int4) +RETURNS int4[] +AS 'MODULE_PATHNAME','int_agg_final_array' +LANGUAGE 'C'; -- The aggration funcion. -- uses the above functions to create an array of integers from an aggregation. -create aggregate int_array_aggregate -( +CREATE OR REPLACE AGGREGATE int_array_aggregate ( BASETYPE = int4, SFUNC = int_agg_state, STYPE = int4, @@ -33,8 +30,7 @@ create aggregate int_array_aggregate -- The enumeration function -- returns each element in a one dimentional integer array -- as a row. -create function int_array_enum(int4[]) - returns setof integer - as 'MODULE_PATHNAME','int_enum' - language 'c'; - +CREATE OR REPLACE FUNCTION int_array_enum(int4[]) +RETURNS setof integer +AS 'MODULE_PATHNAME','int_enum' +LANGUAGE 'C'; |
