Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

adjust/postgres_agg_funcs

Repository files navigation

postgres_agg_funcs

This implements some aggregation helper functions for postgres hstore written in C. This is basically a rewrite in C of the SQL implementations described in http://big-elephants.com/2012-10/aggregations-with-pg-hstore/

array_count

Select array_count(Array['foo','bar','foo','baz'])
 -- => "bar"=>"1", "baz"=>"1", "foo"=>"2"

hstore_add

Select hstore_add('a=>1,b=>2'::hstore ,'a=>1,c=>2'::hstore)
-- => "a"=>"2", "b"=>"2", "c"=>"2"

array_uniq

Select array_uniq(Array[1,5,9,4,1,9])
-- => "{1,4,5,9}"

Build:

bash build.sh

Mac OS:

If you are on Mac OS using homebrew you can use the included Formular postgres_agg_funcs.rb Otherwise use and adapt the build_mac.sh script to your needs.

License

This Software is licensed under the MIT License.

Copyright (c) 2012 adeven GmbH, http://www.adeven.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

aggregation helper functions written in c

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •