It's not the INSERT that is the problem, it is the invalid SQL that you are trying to issue. Try your insert first then a separate count(*) query, or if you are using PostgreSQL 9.1+ you can use Common Table Expressions and RETURNING
WITH ins AS (
insert into tableinfo ("table","date")
values ('Sell','24 August') RETURNING "table"
)
select count(*)
from ins;