Possible Duplicate:
Insert, on duplicate update (postgresql)
Is this possible on PostgreSQL:
insert record, if the record doesn't exists
else update existing record
Supposedly that the record will be inserted in this table structure:
[userid - unique] [count]
If there was an existing record, I will just update the count or insert if it doesn't exists