Dirk Lutzebaeck <lutzeb(at)aeccom(dot)com> writes:
> *** the aggregate is then created by
> CREATE AGGREGATE maxalphanum (
> SFUNC1 = maxalphanum_check,
> BASETYPE = TEXT,
> STYPE1 = TEXT
> );
You've not specified any initial condition for the aggregate's state
value. This means the state starts out NULL ... and your transition
function isn't handling that.
You probably want to mark the transition function 'strict', but you
also need to consider what the initial condition should be: what do
you want returned for no input rows?
regards, tom lane