Re: [PHP-PEAR] possible bug in DB/pgsql.php
[email protected] ("Stig S. Bakken")
| Newsgroups | php.pear |
|---|---|
| Organization | Fast Search & Transfer |
| Message-ID | <[email protected]> |
[email protected] wrote: > > On 12 Feb 2001, at 18:20, [email protected] wrote: > > ..replying to myself... > > Since I was finding difficulty to concentrate on my work this > afternoon, I decided to investigate on this a little further, so I > checked out CVS version. > > > In reality, $database->autocommit(FALSE) should have raised an > > error, since it's not supported in the PGSQL port (at least in my > > version)... > > > OK, I've seen that the CVS version doesn't complain, so this is true. > In fact, this version does try to work in transaction mode, but in the > wrong way, it seems. That is, it appends an explicit "COMMIT" > after the query if the user chooses "autocommit" mode. > The problem is, postgresql works in a opposite way to most SQL > Dbs: it appends that "commit" itself, by default. If you do NOT want > to do it, you have to explicitly open a transaction block with the > non-standard keyword "begin". Without it, the "commit" is > redundant and for this reason the backend complains the notice > that Stig silenced with an "ugly hack" (his words, I would have > called it "black magic" :-))... > > So, at the moment, DB_pgsql does only half of the work. To do it > full, there should be an explicit "begin" somewhere. If this cannot > be "user required" as i suggested in my previous message, the > hard part is finding where... > > If someone feels I should speculate more on this, feel free to ask... > if some other one feels like I should shut up, please be kind on me > and don't roast my butt - I'm having an hell of a life lately :-( Ok, what if we take away the implicit "commit" after each query when auto-commit is on, and add an implicit "begin" before each query when auto-commit is off instead? I would like to avoid having more than one transaction paradigm. :-) - Stig