Aggregates.CREATE AGGREGATE renders and introspects: the definition is reconstructed from pg_aggregate (canonical option tuple, non-default options only), a replacement decomposes to drop + create (Postgres has no CREATE OR REPLACE AGGREGATE), and every addressing statement carries the signature Postgres requires.
Fixed
A created materialized view brings its indexes. Creating a materialized view now renders its index definitions alongside it; previously they were left out of the plan.