I'd definitely try the commit to see if that does the trick, but I'd also check to see if the statement had an error or not. If it *does*, then you can use the AutoCommit flag on the connect statement to avoid having to do a commit after every operation (though you might prefer the safety of handling commit yourself).
Since you could be getting an error from Pg, you'll want to check the error status of any command. An insert will fail if you violate a constraint on the table for example. So I tell DBI (on the connect statement) to check every statement and raise errors (using RaiseError and PrintError).
When your only tool is a hammer, all problems look like your thumb.