On Mon, 9 Sep 2002, Steve Howe wrote:
> JW> Steve Howe wrote: > >> > >> Hello all, > >> > >> PostgreSQL *still* has a bug where PQcmdStatus() won't return the > >> number of rows updated. But that is essential for applications, since > >> without it of course we don't know if the updates/delete/insert > >> commands succeded. Even worst, on interfaces like Delphi/dbExpress the > >> program will return an error message and rollback transaction thinking > >> nothing have been updated. In other words, unusable. As a note, I assume you realize that it returning any number doesn't guarantee that the command succeeded if you assume succeeding means doing what the statement sent would appear to do. ;) Although I think we need to change the current behavior, we are turning a false "failure" into a potentially false "success" (I did an update, it said two rows were changed but there's no visible data change in the entire system?) Fortunately, the likely bad effects from the false "success" are probably only going to happen in somewhat degenerate cases. I quote "failure" and "success" because there's already a notion of success and failure which is raising an exception condition or not (AFAICT 0 rows is a completion condition - the statement succeeded but nothing was modified). As such, using the count to determine success of the statement is wrong for an interface, but it may be meaningful for applications attempting to apply some sort of business logic. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html