ID:          34719
 Updated by:  [EMAIL PROTECTED]
 Reported By: bouchon at alussinan dot org
 Status:      Open
 Bug Type:    Documentation problem
 PHP Version: Irrelevant
 New Comment:

Actually, pg_query() automatically encloses everything in a transaction
block, unless a transaction has already been started - in which case the
queries again fit into one transaction.

However, you're right - it would be good to mention that multiple
queries could be passed to pg_query() and they all are executed as one
transaction.



Previous Comments:
------------------------------------------------------------------------

[2005-10-03 17:08:46] bouchon at alussinan dot org

Description:
------------
Hello,

I would like to propose to add a short explanation inside the
documentation of the pg_query function, about transactions :

##

Note that the pg_query() function can also take several queries embeded
inside one transaction block.

Example :

$SQLQuery = 'BEGIN;';
$SQLQuery.= 'INSERT INTO a (a,b) VALUES (1,2);';
$SQLQuery.= 'INSERT INTO b (ref_b,c) VALUES (2,5);';
$SQLQuery.= 'COMMIT;';

$HandleResults = pg_query($SQLQuery);


The essential point of a transaction is that it bundles multiple steps
into a single, all-or-nothing operation. You can get more informations
about transaction on
http://www.postgresql.org/docs/8.0/interactive/tutorial-transactions.html
##

I think that this feature should be mentionned inside the pg_query()
function documentation. If this proposal is accepted, feel free to
rewrite it in a better english.

Kind regards,

-- 
Bruno BAGUETTE - [EMAIL PROTECTED]
(hardly filtered mail, but I read answers on the newsgroup) 



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34719&edit=1

Reply via email to