---
title: "#217: Writing Your Own Aggregation Functions"
publication: "Postgres Weekly"
issue: 217
published_at: "2017-07-26"
canonical_url: "https://postgresweekly.com/issues/217"
---

Postgres Weekly 217   . 

[Read this on the Web](http://postgresweekly.com/issues/217) 

[Postgres Weekly](http://postgresweekly.com) Issue 217 — July 26, 2017     

[Writing Your Own Aggregation Functions](http://www.cybertec.at/writing-your-own-aggregation-functions/?utm_source=postgresweekly&utm_medium=email)_“In many cases basic functions are not enough and it makes sense to create your own code to make sure that calculations can still be done on the server side.”_ Hans-Juergen Schoenig [A Penetration Tester’s Guide to Postgres](https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9?utm_source=postgresweekly&utm_medium=email)Want to know how secure your Postgres database is? This guide walks you through some basic things you should be careful about. David Hayter [How to Migrate Your Heroku Postgres Database to Amazon RDS](https://www.lewagon.com/blog/how-to-migrate-your-heroku-postgres-database-to-amazon-rds?utm_source=postgresweekly&utm_medium=email)Migrating away from Heroku isn’t a one click process but this tutorial shows working with database dumps isn’t too tricky either. Sébastien Saunier [Find the perfect match for your PostgreSQL database](https://selectstar.io/database/postgresql/)Pair PostgreSQL’s open-source roots with SelectStar’s comprehensive monitoring for the ideal environment. SelectStar#sponsored[![\](https://copm.s3.amazonaws.com/3875c5cf.png)](https://selectstar.io/database/postgresql/) [Outer JOINs and WHERE Clauses](https://www.enterprisedb.com/blog/outer-joins-and%C2%A0where%C2%A0clauses?utm_source=postgresweekly&utm_medium=email)Bruce Momjian discusses how Postgres supports both traditional JOIN syntax, which uses the WHERE clause to specify joined columns, and ANSI JOIN syntax, that uses the word JOIN in the FROM clause. EnterpriseDB [PostgreSQL Index Bloat Under A Microscope](https://pgeoghegan.blogspot.com/2017/07/postgresql-index-bloat-microscope.html?utm_source=postgresweekly&utm_medium=email)A look into analyzing the keyspace of a target B-Tree index for performance purposes. Peter Geoghegan [Removing Duplicates in a Postgres Array](https://medium.com/the-falconry/removing-duplicates-in-a-postgresql-array-c972e4ed3bf0?utm_source=postgresweekly&utm_medium=email)How to eliminate duplicate text array elements. Moof Mayeda [Creating Log Tables to Store Historical Data for Richer Reporting](https://blog.fishtownanalytics.com/analytics-playbook-log-tables-7df0e6aacb42?utm_source=postgresweekly&utm_medium=email)Audit logs can be useful for a number of purposes, and there’s a bunch of ways you can implement them. Here’s one approach that aims to make it a bit easier. Fishtown Analytics [Linux cloud hosting starting at 1GB of RAM for $5/mo](http://welcome.linode.com/postgres-weekly/?utm_source=cooperpress&utm_medium=sponsored&utm_campaign=postgres-weekly-sponsored)Get a Linode server up and running in seconds. Use promo code POSTGRES20 for a $20 credit on a new account. Linode#sponsored [ldap2pg 2.0: Sync Postgres Roles and ACLs with LDAP Directories](https://github.com/dalibo/ldap2pg?utm_source=postgresweekly&utm_medium=email#readme) Dalibo#tools [pg_chameleon: A MySQL to Postgres Replication Tool](https://github.com/the4thdoctor/pg_chameleon/releases/tag/v1.5?utm_source=postgresweekly&utm_medium=email) Federico Campoli#tools [piggy: A PostgreSQL Script Runner for Migrations](https://github.com/datalust/piggy?utm_source=postgresweekly&utm_medium=email)A tool for managing schema and data changes to PostgreSQL databases. Datalust#tools    

Postgres Weekly is curated by [Craig Kerstiens](https://twitter.com/craigkerstiens) [Read this issue on the Web](http://postgresweekly.com/issues/217) [See our archives](http://postgresweekly.com/issues) [Change your email address](*|UPDATE_PROFILE|*)  [Stop getting this newsletter](*|UNSUB|*)  

Published by [Cooperpress](https://cooperpress.com/)
Fairfield Enterprise Centre, Lincoln Way, Louth, LN11 0LS, UK
