Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
aggregation helper functions written in c
C Shell Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README.md
add.c
avltree.c
avltree.h
build.sh
build_mac.sh
count.c
hstore.h
postgres_agg.sql
postgres_agg_funcs.rb
uniq.c

README.md

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.

Something went wrong with that request. Please try again.