What I would like is to count the array elements which corresponds to true (attendance), false (non-attendance) and NULL for any single event.
EDIT:
I just realized that arrays do not behave as I thought in pSQL, so a simple
userconfirm bool[]
Might suffice. However, I am still having the same problem counting true/false/null values. I will attempt to edit the question below to match this new constraint. I apologize for any errors.
I have a column such as
userconfirm bool[]
Where userconfirm[314] = true
would mean that user #314 will attend. (false = no attend, NULL = not read/etc).
I'm not sure this is the best solution for this functionality (users announce their attendance to an event), but I am having trouble with an aggregate function on this column.
select count(*) from foo where id = 6 AND true = ANY (userconfirm);
This only returns 1, and trying to google "counting arrays" does not turn up anything useful.
How would I go about counting the different values for a single event?