possible bug in DB/pgsql.php

[email protected] (Burak DAYIOGLU)
Newsgroups php.pear
Message-ID <[email protected]>
Hello,
I have asked Mr. Bakken about transaction management in DB/pgsql.php
before via a private msg. I have had written a quick hack to check out
how it works...

The below code is assumed to make two inserts and rollback afterwards.
I was expecting to see no records inserted however both inserts ended
with success.

Any ideas on how to implement transactions with postgresql? Am I doing
anything wrong? (BTW, running on RH6.2 Linux w/ Php4.0.4pl1, cvs
synched fresh PEAR and pgsql 7.0.3...)

with regards,
-bd

<?php
        require_once("/usr/local/lib/php/DB.php");
        $database=DB::factory("pgsql");
       
$dsn=array(phptype=>"pgsql",hostspec=>"localhost",database=>"kek");
        $database->connect($dsn);
        $database->autocommit(FALSE);
        $handle=$database->query("insert into names values
(1,'burak')");
        $handle=$database->query("insert into cities values
(2,'ankara')");
        $database->rollback();
?>
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.