From 74883d33730ecb69e6f4142deb8c5882af127b32 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 14 Feb 2011 20:59:42 -0500 Subject: Rethink naming of contrib/intagg extension. Initially it was called int_aggregate after the old SQL file, but since the documentation just says "intagg" and that's also the directory name, let's conform to that instead. --- contrib/intagg/Makefile | 4 +-- contrib/intagg/int_aggregate--1.0.sql | 32 ----------------------- contrib/intagg/int_aggregate--unpackaged--1.0.sql | 6 ----- contrib/intagg/int_aggregate.control | 4 --- contrib/intagg/intagg--1.0.sql | 32 +++++++++++++++++++++++ contrib/intagg/intagg--unpackaged--1.0.sql | 6 +++++ contrib/intagg/intagg.control | 4 +++ 7 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 contrib/intagg/int_aggregate--1.0.sql delete mode 100644 contrib/intagg/int_aggregate--unpackaged--1.0.sql delete mode 100644 contrib/intagg/int_aggregate.control create mode 100644 contrib/intagg/intagg--1.0.sql create mode 100644 contrib/intagg/intagg--unpackaged--1.0.sql create mode 100644 contrib/intagg/intagg.control diff --git a/contrib/intagg/Makefile b/contrib/intagg/Makefile index 372c0919a7..2cfe9978e2 100644 --- a/contrib/intagg/Makefile +++ b/contrib/intagg/Makefile @@ -1,7 +1,7 @@ # contrib/intagg/Makefile -EXTENSION = int_aggregate -DATA = int_aggregate--1.0.sql int_aggregate--unpackaged--1.0.sql +EXTENSION = intagg +DATA = intagg--1.0.sql intagg--unpackaged--1.0.sql ifdef USE_PGXS PG_CONFIG = pg_config diff --git a/contrib/intagg/int_aggregate--1.0.sql b/contrib/intagg/int_aggregate--1.0.sql deleted file mode 100644 index ce78d17b77..0000000000 --- a/contrib/intagg/int_aggregate--1.0.sql +++ /dev/null @@ -1,32 +0,0 @@ -/* contrib/intagg/int_aggregate--1.0.sql */ - --- Internal function for the aggregate --- Is called for each item in an aggregation -CREATE FUNCTION int_agg_state (internal, int4) -RETURNS internal -AS 'array_agg_transfn' -LANGUAGE INTERNAL; - --- Internal function for the aggregate --- Is called at the end of the aggregation, and returns an array. -CREATE FUNCTION int_agg_final_array (internal) -RETURNS int4[] -AS 'array_agg_finalfn' -LANGUAGE INTERNAL; - --- The aggregate function itself --- uses the above functions to create an array of integers from an aggregation. -CREATE AGGREGATE int_array_aggregate ( - BASETYPE = int4, - SFUNC = int_agg_state, - STYPE = internal, - FINALFUNC = int_agg_final_array -); - --- The enumeration function --- returns each element in a one dimensional integer array --- as a row. -CREATE FUNCTION int_array_enum(int4[]) -RETURNS setof integer -AS 'array_unnest' -LANGUAGE INTERNAL IMMUTABLE STRICT; diff --git a/contrib/intagg/int_aggregate--unpackaged--1.0.sql b/contrib/intagg/int_aggregate--unpackaged--1.0.sql deleted file mode 100644 index 0bc874e645..0000000000 --- a/contrib/intagg/int_aggregate--unpackaged--1.0.sql +++ /dev/null @@ -1,6 +0,0 @@ -/* contrib/intagg/int_aggregate--unpackaged--1.0.sql */ - -ALTER EXTENSION int_aggregate ADD function int_agg_state(internal,integer); -ALTER EXTENSION int_aggregate ADD function int_agg_final_array(internal); -ALTER EXTENSION int_aggregate ADD function int_array_aggregate(integer); -ALTER EXTENSION int_aggregate ADD function int_array_enum(integer[]); diff --git a/contrib/intagg/int_aggregate.control b/contrib/intagg/int_aggregate.control deleted file mode 100644 index f8e47d5a7f..0000000000 --- a/contrib/intagg/int_aggregate.control +++ /dev/null @@ -1,4 +0,0 @@ -# int_aggregate extension -comment = 'integer aggregator and enumerator (obsolete)' -default_version = '1.0' -relocatable = true diff --git a/contrib/intagg/intagg--1.0.sql b/contrib/intagg/intagg--1.0.sql new file mode 100644 index 0000000000..19a57c079b --- /dev/null +++ b/contrib/intagg/intagg--1.0.sql @@ -0,0 +1,32 @@ +/* contrib/intagg/intagg--1.0.sql */ + +-- Internal function for the aggregate +-- Is called for each item in an aggregation +CREATE FUNCTION int_agg_state (internal, int4) +RETURNS internal +AS 'array_agg_transfn' +LANGUAGE INTERNAL; + +-- Internal function for the aggregate +-- Is called at the end of the aggregation, and returns an array. +CREATE FUNCTION int_agg_final_array (internal) +RETURNS int4[] +AS 'array_agg_finalfn' +LANGUAGE INTERNAL; + +-- The aggregate function itself +-- uses the above functions to create an array of integers from an aggregation. +CREATE AGGREGATE int_array_aggregate ( + BASETYPE = int4, + SFUNC = int_agg_state, + STYPE = internal, + FINALFUNC = int_agg_final_array +); + +-- The enumeration function +-- returns each element in a one dimensional integer array +-- as a row. +CREATE FUNCTION int_array_enum(int4[]) +RETURNS setof integer +AS 'array_unnest' +LANGUAGE INTERNAL IMMUTABLE STRICT; diff --git a/contrib/intagg/intagg--unpackaged--1.0.sql b/contrib/intagg/intagg--unpackaged--1.0.sql new file mode 100644 index 0000000000..95238d9c67 --- /dev/null +++ b/contrib/intagg/intagg--unpackaged--1.0.sql @@ -0,0 +1,6 @@ +/* contrib/intagg/intagg--unpackaged--1.0.sql */ + +ALTER EXTENSION intagg ADD function int_agg_state(internal,integer); +ALTER EXTENSION intagg ADD function int_agg_final_array(internal); +ALTER EXTENSION intagg ADD function int_array_aggregate(integer); +ALTER EXTENSION intagg ADD function int_array_enum(integer[]); diff --git a/contrib/intagg/intagg.control b/contrib/intagg/intagg.control new file mode 100644 index 0000000000..f11fb11940 --- /dev/null +++ b/contrib/intagg/intagg.control @@ -0,0 +1,4 @@ +# intagg extension +comment = 'integer aggregator and enumerator (obsolete)' +default_version = '1.0' +relocatable = true -- cgit v1.2.1