mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained 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';
|
||||
|
Reference in New Issue
Block a user