Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Postgresql 中,您可以使用
CREATE AGGREGATE name(...);
但是,如果数据库中已经存在聚合,则会出现错误,那么如何检查 Postgres 数据库中是否已经存在聚合?
SELECT * FROM pg_proc WHERE proname = 'name' AND proisagg;
drop aggregate if exists my_agg(varchar); create aggregate my_agg(varchar) (...); select * from pg_aggregate where aggfnoid = 'my_agg'::regproc;