<p>In Postgresql you can create additional Aggregate Functions with </p>

<pre><code>CREATE AGGREGATE name(...);
</code></pre>

<p>But this gives an error if the aggregate already exists inside the database, so how can I check if a Aggregate already exists in the Postgres Database? </p>

```
```
SELECT * FROM pg_proc WHERE proname = 'name' AND proisagg;
```
```
http://www.postgresql.org/docs/8.3/interactive/catalogs-overview.html
http://www.postgresql.org/docs/8.3/interactive/catalog-pg-aggregate.html
http://www.postgresql.org/docs/8.3/interactive/catalog-pg-proc.html