How to check existing aggregate functions in Postgres?

In Postgresql, you can create additional aggregate functions with

CREATE AGGREGATE name(...); 

But this gives an error if the aggregate already exists inside the database, so how can I check if the aggregate exists in the Postgres database?

+4
source share
2 answers
 drop aggregate if exists my_agg(varchar); create aggregate my_agg(varchar) (...); select * from pg_aggregate where aggfnoid = 'my_agg'::regproc; 
0
source

All Articles