Search Postgresql Archives

pg_query transaction: auto rollback? begin or start?? commit or end???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is this recommended?

pg_query("begin transaction read write;", $connection);
if(pg_transaction_status($connection) == 2) {
	pg_query("insert...;", $connection);
	pg_query("insert...;", $connection);
	pg_query("insert...;", $connection);
}
pg_query("commit transaction;", $connection);
pg_close($connection);

Now *any* error inside transaction will trigger auto rollback for
*all* inserts so I don't need to explicitly issue conditional
rollback? Also is "begin/commit transaction" == "start/end
transaction"??
Cheers, Bill


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux