Custom Aggregate Postgresql C extension with input as initial condition
If you need to pass an argument to an aggregate function, just do it. That argument does not have to be a table column.

For example:

SELECT myagg(col1, 'initial value') FROM atable;


True, you could also call the function as

SELECT myagg(col1, col2) FROM atable;


but nobody forces you to do that, if you want the second argument to be a constant used for initializing then state.