For a simple insert statement, execute() should never return '0E0'. It will return undef if there's an error, or '1' if a row was inserted (though I would use RaiseError in which case it would die on error). For a 'insert into ... select ... from' type insert statement, it might return '0E0' if zero rows were selected/inserted (which is not an error), or more if rows were inserted, or (again) undef if there was an error.