Question

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 a Aggregate already exists in the Postgres Database?

OTHER TIPS

drop aggregate if exists my_agg(varchar);

create aggregate my_agg(varchar) (...);

select * from pg_aggregate
where aggfnoid = 'my_agg'::regproc;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top