Re: [PHP-PEAR] possible bug in DB/pgsql.php

[email protected]
Newsgroups php.pear
Message-ID <3A883A5F.31916.247B75A@localhost>
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 :-(

Just my 0.02 Euro

Fabrizio




/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini               Alternate E-mail:
C.so Umberto, 7               [email protected]
loc. Meleto Valdarno          Mail on GSM: (keep it short!)
52020 Cavriglia (AR)          [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.