PostgreSQL database manipulation  with c