In CREATE AGGREGATE, allow the transition datatype to be "internal", but only
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Nov 2008 19:47:50 +0000 (19:47 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Nov 2008 19:47:50 +0000 (19:47 +0000)
commit04ceebf6ed24981818af13bc9a447b8acf0c1b53
tree7d32f32535f0141016ce5683ac74d17e4d68944e
parent7cc080cc94eecaeea3077b9e94bb8015df9c2826
In CREATE AGGREGATE, allow the transition datatype to be "internal", but only
if the user is superuser.  This makes available to extension modules the same
sort of trick being practiced by array_agg().  The reason for the superuser
restriction is that you could crash the system by connecting up an
incompatible pair of internal-using functions as an aggregate.  It shouldn't
interfere with any legitimate use, since you'd have to be superuser to create
the internal-using transition and final functions anyway.
src/backend/catalog/pg_aggregate.c
src/backend/commands/aggregatecmds.c